一、效果体验

运行效果
二、官网说明
地址:https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-with-EDK-II

Getting Started with EDK II
三、环境准备
1、win10 x86_64位

pc环境
2、VS2017
下载vs2017专业版 (地址:https://msdn.itellyou.cn/)

下载Visual Studio Professional 2017
3、Python3.7.8
下载python3.7.8 (地址:https://www.python.org/downloads/windows/)
安装到C:\Python

下载Python 3.7.8
注意:安装的目录名不要有空格。
4、IASL
下载地址:https://acpica.org/sites/acpica/files/iasl-win-20200717.zip
解压到C:\IASL

下载IASL
5、NASM
官网版本库:https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D
下载地址:https://www.nasm.us/pub/nasm/releasebuilds/2.15.02/win64/
安装到C:\NASM

下载nasm-2.15.02-installer-x64.exe
6、EDK II源码
下载源码 :https://github.com/tianocore/edk2/tags
本节使用的是:edk2-stable202002版本
解压到自己的工作目录

下载edk2-stable202002
四、环境变量配置
1、配置Path变量

系统变量Path中添加
2、新增PYTHON_HOME变量

添加PYTHON_HOME变量
五、开始编译
官网说明:https://github.com/tianocore/tianocore.github.io/wiki/Windows-systems
以下步骤均在cmd中运行,总结如下:
所在目录为EDK II源码根目录

5-1 首次编译步骤
5.2 重新编译
\edk2>set PYTHON_HOME=C:\Python
\edk2>edksetup.bat Rebuild
\edk2 edksetup.bat
\edk2>notepad Conf\target.txt
修改:TOOL_CHAIN_TAG = VS2017
保存target.txt
\edk2>build
编译成功后,你应该会看到如下信息:

编译成功效果
六、运行模拟环境
\edk2>cd Build\EmulatorIA32\DEBUG_VS2017\IA32
\edk2\Build\EmulatorIA32\DEBUG_VS2017\IA32>WinHost.exe

生成文件

运行效果-1

运行效果-2