当前位置: 首页 > news >正文

UEFI 01记: 开发环境 在 ubuntu22 中搭建 edk2 开发环境并运行简单示例

https://uefi.org

1,预备环境

$ sudo apt install uuid-dev
$ sudo apt install nasm
$ sudo apt install bison flex
$ sudo apt install build-essential
$ sudo apt-get install x11proto-xext-dev
$ sudo apt-get install libx11-dev
$ sudo apt-get install libxext-dev
$ gcc -version
$ make --version
$ gcc --version


2,下载源代码

$ git clone http://github.com/tianocore/edk2.git
$ git clone http://github.comtianocore/edk2-libc.git
$ git clone http://github.com/tianocore/edk2-libc.git
$ git clone http://github.com/acpica/acpica.git
$ cd edk2
$ git submodule update --init
$ cd -

3,构建edk2

$ make -C edk2/BaseTools
$ python --version

$ uname -a
$ make -C ./acpica/

4,设置环境变量

$ touch setup_env.sh
$ vim setup_env.sh
$ cat setup_env.sh$ export WORKSPACE=$PWD
$ export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-libc
$ export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-libc
$ export IASL_PREFIX=\$PWD/acpica/generate/unix/bin/
$ export PYTHON_COMMAND=/usr/bin/python3$ . ./setup_env.sh
$ source edk2/edksetup.sh

5,构建模拟器和uefi

$ build -p edk2/EmulatorPkg/EmulatorPkg.dsc -t GCC5 -a X64


$ build -p edk2-libc/AppPkg/AppPkg.dsc -t GCC5 -a X64

6,运行模拟器和uefi

$ cd ./Build/EmulatorX64/DEBUG_GCC5/X64/
$ ls ./Host
$ ./Host

 Shell:>fs0:

FS0:\>HelloWorld.efi

7,环境和版本信息

过程非常顺利,没有遇到任何问题,做一下信息记录,备查

archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev$ python --version
Python 3.10.12
archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev$ cd edk2
archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev/edk2$ git log -2
commit b158dad150bf02879668f72ce306445250838201 (HEAD -> master, origin/master, origin/HEAD)
Author: Ashraf Ali <ashraf.ali.s@intel.com>
Date:   Sun Aug 11 21:31:12 2024 +0530EmulatorPkg: VS2022 Support on WinHost.Currently EDK2 is supporting VS2022, with VS2022 EmulatorPkg build isfailing, this patch is to add the VS2022 support for WinHostSigned-off-by: Ashraf Ali <ashraf.ali.s@intel.com>commit b0f43dd3fdec2363e3548ec31eb455dc1c4ac761
Author: Dat Mach <dmach@nvidia.com>
Date:   Tue Jun 25 15:07:38 2024 -0700DynamicTablesPkg: Add parser for Tpm2 CM objectUpdate the CM Object parser to add support for parsing theCM_ARM_TPM2_INTERFACE_INFO object.Signed-off-by: Dat Mach <dmach@nvidia.com>
archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev/edk2$ cd ../edk2-libc/
archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev/edk2-libc$ git log -1
commit 87108465dcfbf888b8044ae86b4dc84b04b19082 (HEAD -> master, origin/master, origin/HEAD)
Author: Jayaprakash, N <n.jayaprakash@intel.com>
Date:   Tue Jul 30 21:47:06 2024 +0530edk2-libc: remove gitmodules file added through accidental commitREF: https://bugzilla.tianocore.org/show_bug.cgi?id=4822Due to an accidental commit went into edk2-libc whileexperimenting with some inner-source repos lead to the additionof gitmodules file and a submodule. This commit is undoingthis change by removing the gitmodules file and the submodule.Cc: Rebecca Cran <rebecca@bsdio.com>Cc: Michael D Kinney <michael.d.kinney@intel.com>Cc: Jayaprakash N <n.jayaprakash@intel.com>Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev/edk2-libc$ cd ../acpica/
archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev/acpica$ git log -1
commit c1ac0dcb84b529fa04d0f94d624344584d92e183 (HEAD -> master, origin/master, origin/HEAD)
Merge: 45f86f4bd fad7ed029
Author: Saket Dumbre <saket.dumbre@intel.com>
Date:   Tue Aug 20 16:46:29 2024 -0700Merge pull request #966 from Wer-Wolf/phat-fixPHAT: Various fixes
archer@archer-Z3-Pro-Series-GM5TG0O:~/ex_uefi_dev/acpica$ 


http://www.mrgr.cn/news/6802.html

相关文章:

  • 虚幻5|AI视力系统,听力系统,预测系统(2)听力系统
  • 《计算机组成原理》(第3版)考研真题
  • 机器学习预处理
  • 备考2024年美国数学竞赛AMC10:吃透1250道历年真题和知识点(持续)
  • 【Java 数据结构】排序
  • 费马小定理求解逆元模板
  • mysql与redis结合使用
  • C#实现数据采集系统-数据反写(3)ModbusTcp写入数据模块开发
  • C++基础面试题 | C和C++的区别?
  • 企业数字化转型会面临哪些挑战,如何解决?
  • 【软件造价咨询】信息化项目造价之服务器如何做选型配置论证分析
  • YOLOv9改进策略【注意力机制篇】| 引入SimAM注意力模块(一个简单的,无参数的卷积神经网络注意模块)
  • 婚恋交友系统该如何制作成品系统?
  • 【计算机组成原理】2.2.1_4 算数逻辑单元ALU
  • 关于前端form提交后端返回文件流触发浏览器下载(并发控制)
  • 北京,为什么会成为一个绿灯过人行道还要小心被车撞的城市?
  • UPROPERTY(meta = (BindWidget))的含义
  • C# 调用接口处理返回json数据
  • 设计模式六大原则(一)--单一职责原则
  • UE5-C++入门教程(二)---编写Editor类别的自定义模型实现小球规划路线的可视化