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$
8, ACPI 参考
slideshare.net/suselab/acpi-debugging-from-linux-kernel, acpica.org/sites/acpica/files/asl_tutorial_v20190625.pdf