一、Windows下环境的搭建
1.安装windows下nasm汇编支持
2.安装python(安装PATH方式)
3.安装vs2017
操作执行: 在根目录执行edksetup.bat,确认PATH是否正确
在BaseTool里面,编译工具,使用nmake
然后buildEmulatorPkg ,最后跑模拟器调试(在buildEmulatorPkg 的ReadMe查看)
二、linux下环境搭建
1.更新软件源,sudo apt-get update
2.安装gcc4.8
sudo apt-get install gcc-4.8 g++-4.8
如果已经安装gcc,可以使用下面命令切换
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50
sudo update-alternatives --config gcc
3.安装nasm
sudo apt-get install nasm
4.安装build
sudo apt-get install build-essential uuid-dev
5.安装python
sudo apt-get install python
sudo apt-get install python-pip
sudo apt-get install python3-distutils
6.在edk根目录执行
source edksetup.sh
7.在 BaseTools目录下编译工具
make
8.在edk2/EmulatorPkg/EmulatorPkg.dsc修改为
##
# PEI Phase modules
##
MdeModulePkg/Core/Pei/PeiMain.inf{
<BuildOptions>
*_*_*_CC_FLAGS=-O0
}
/usr/bin/cgdb $BUILD_ROOT_ARCH/Host -q -cd=$BUILD_ROOT_ARCH -x $WORKSPACE/EmulatorPkg/Unix/GdbRun.sh
代码下载:github搜索EDKII