This article assumes that you have Visual Studio 2012 installed and that EDK2 has been downloaded to C:\sourcecode\edk2.
If you would like to create the environment in Visual Studio 2010, please click here.
If you would like to create the environment in Visual Studio 2008, please click here.
Create New Visual Studio Project
These steps will set up Visual Studio 2012 so that it can build the Windows-hosted (NT32) environment.

1. Select File -> New Project.
2. Select the "Visual C++" category and select "MakeFile Project." Enter the name as "NT32"
press "OK."



6. Select the category "Configuration Properties", then select "NMake."


cd /D c:\sourcecode\edk2
set WORKSPACE=c:\sourcecode\edk2
call edksetup.bat --nt32
build

cd /D c:\sourcecode\edk2
set WORKSPACE=c:\sourcecode\edk2
call edksetup.bat --nt32
build clean
build

cd /D c:\sourcecode\edk2
set WORKSPACE=c:\sourcecode\edk2
call edksetup.bat --nt32
build clean
11. Go to the category "Debugging."

c:\sourcecode\edk2\Build\NT32IA32\DEBUG_VS2012x86\IA32\SecMain.exe

c:\sourcecode\edk2\Build\NT32IA32\DEBUG_VS2012x86\IA32
14. Press "OK."


16. Paste the files to c:\sourcecode\edk2\Conf and change both files into .txt files.

17. Once you have moved these two files, open target.txt. Find the line that begins with After TOOL_CHAIN_TAG, the line reads MYTOOLS. Replace MYTOOLS with VS2012x86 and save the file.
TOOL_CHAIN_TAG.
Launching the Windows-Hosted Environment



At this point, at least two windows should open: the debug output console window and then the graphics output window.
The graphics output window will show a fake logo and a progress bar.

5 comments:
Nice, thanks for the tutorial, I noticed two things:
...\DEBUG_VS2010x86\..
should be changed to .../DEBUG_VS2012x86/...
and I also had to change the TOOL_CHAIN_TAG om target.txt from MYTOOLS to VS2012x86 to get it working.
@suli You just beat me to it :)
Alternatively you can modify the build command in Solution properties for building and cleaning.
s/build/build -t VS2012x86/
This has another advantage. You do not need to copy the *.template files in Conf directory. They are generated automatically by edk2 (with updated TOOL_CHAIN_TAG).
For more info you can refer to BuildNotes2.txt in edk2/ root directory.
The blog article has been updated per your suggestions.
Will this work on 64 bit machine?
The build fails on Windows 32bit, cause VS2012x86 target will instruct the build to use "Program Files 0x86\...\" path to nmake.exe. So you must replace VS2012x86 with VS2012 in the Debug Commands.
c:\MyWorkSpace\Build\NT32IA32\DEBUG_VS2013\IA32\SecMain.exe
c:\MyWorkSpace\Build\NT32IA32\DEBUG_VS2013\IA32\
Post a Comment