Tuesday, July 21, 2015

UEFI/EDK2 EmulatorPkg in Ubuntu


This post will explains the steps involved in compiling EmulatorPkg of Tianocore EDK2. Who wish to learn UEFI can use this emulator for writing UEFI samples.
Step 1: Clone git repository from github git clone https://github.com/tianocore/edk2.git
Step 2: Inside git repo, setup the environment using source edksetup.sh
Step 3: Compile the BaseTools. Before compiling it, do sudo apt-get install uuid-dev then make -C BaseTools
Step 4: Set Build Target Information
For the Conf/target.txt file, find the following lines:
ACTIVE_PLATFORM       = Nt32Pkg/Nt32Pkg.dsc
TARGET_ARCH           = IA32
TOOL_CHAIN_TAG        = MYTOOLS
And change the corresponding lines to match these:
ACTIVE_PLATFORM       = MdeModulePkg/MdeModulePkg.dsc
TARGET_ARCH           = IA32
TOOL_CHAIN_TAG        = GCC46
Note TARGET_ARCH and TOOL_CHAIN_TAG depends on your machine.
My machine Info gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
jeyaram@jeyaram-VirtualBox:~/UEFI_EDK2/edk2$ uname -a
Linux jeyaram-VirtualBox 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux
Step 5: Enter into EmulatorPkg and issue ./build.sh run
Few screenshots for your reference.





Now you are ready to do experiments on UEFI.