This article assumes that you have Visual Studio 2010 installed and that EDKII has been downloaded to C:\edk2
Create New Visual Studio Project
This step's goal is to set up Visual Studio so that it can build the Windows-hosted (NT32) environment
1. Select File->New->Project

3. The Makefile Project Wizard will pop up. Click "Finish."



7. Select "Build Command Line" and click the drop-down arrow on the right. Click "<Edit...>"
8. This will pop up a separate editor box. On three separate lines, enter the following text and click "OK."
cd /D c:\edk2
set WORKSPACE=c:\edk2
call edksetup.bat --nt32
build
9. Now, for "Rebuild All Command Line," enter
cd /D c:\edk2
set WORKSPACE=c:\edk2
call edksetup.bat --nt32
build clean
build
10. For "Clean Command Line," enter
cd /D c:\edk2
set WORKSPACE=c:\edk2
call edksetup.bat --nt32
build clean
11. Click "OK."
12. Edit target.txt, which is located in C:\edk2\Conf, and change TOOL_CHAIN_TAG = VS2010x86. By default, it is set to MYTOOLS, which builds in Visual Studio 2008 and will cause build errors.
Launching the Windows-Hosted Environment
At this point, you should be able to build by selecting Build->Build Solution (or using F7). You can run the emulated environment by going to the command prompt and typing:
cd /d c:\edk2\Build\NT32\DEBUG_VS2010x86\IA32
SecMain.exe

Conclusion
That gets us past the first step. Next time, we'll show how to set up the debugger and make the code debugger-friendly in VS 2010.
6 comments:
Nice tutorial - I'll try to use it. BTW: Do you know where 'build' command on Linux ? [ http://askubuntu.com/questions/204093/where-can-i-find-the-build-command-needed-to-build-the-environment-for-edk-2 ] ???
For Linux, you need to invoke 'build' using Python. See BaseTools/Source/Python/build/build.py.
Hi Tim,
How to compile Nt32pkg with x64 architecture? Is it possible?
Currently, there is no 64-bit emulation environment under Windows on TianoCore (there is a Unix one is EmulatorPkg).
The current Nt32Pkg is hard-coded to 32-bits in many places. There is some 32-bit assembly language. It is about 4-5 days work to move it over (I've done it for my company)
Hello! How to set the path to the header file?
Post a Comment