-
Notifications
You must be signed in to change notification settings - Fork 341
Windows systems
Note: New build instructions are available. It is recommended to start with the new instructions if learning how to build edk2 for the first time. This page is retained for reference.
New instructions: Build Instructions
This page provides step-by-step instructions or setting up a EDK II build environment on Windows systems.
Table of Contents
- GitHub Help
- How to Setup the EDK II Tree
- Download Checkout EDK II source tree from Github
- Compile Tools Build EDK II BaseTools for Windows
- BUILD EDK II
GitHub (https://help.github.com/index.html) provides step-by-step instructions for user registration and basic features supported by GitHub.
- Git for Windows OS is available at: (http://git-scm.com/download/win)
- TortoiseGit for windows OS is available at (https://tortoisegit.org/download/)
- The EDK II project repository is available at https://github.com/tianocore/edk2.
Content that is not released under an accepted open source license can be found at https://github.com/tianocore/edk2-non-osi.
Note: the steps below will pull the latest code from edk2 master. To work from a stable release, please refer to the Microsoft Windows build steps for UDK2017: https://github.com/tianocore/tianocore.github.io/wiki/UDK2017-How-to-Build#how-to-build-windows-system
If your network utilizes a firewall with a web proxy, then you may need to configure your proxy information for various command line applications to work. You may need to consult with your network administrator to find out the computer name and port to use for proxy setup. The following commands are common Git Bash examples of how you would configure your proxy by setting an environment variable:
$ git config --global https.proxy <proxyname>.domain.com:<port> $ git config --global http.proxy <proxyname>.domain.com:<port>
Note: Some of the following examples use the Multiple Workspace feature to configure the EDK II BaseTools. More information on the Multiple Workspace feature can be found at the following location.
Download/Checkout the EDK II source tree from Github
- Download EDK II Project
- Open https://github.com/tianocore/edk2 in web browser
- Click on the Clone or Download button (Right Green)
- Click on Download ZIP
- Unzip to C:/
- Rename directory “edk2-master” to “edk2”
Continue to Compile Tools
- Clone the EDK II project repository
- Open Git GUI
- Use Clone Exiting Repository with Source location https://github.com/tianocore/edk2.git
- Select a Target directory C:/edk2
- Check Recursively clone submodules too
- click Clone button
Continue to Compile Tools section
If you use the command line version, then you can easily checkout the edk2 to the C:\edk2 directory with the following git command: Main repository: https://github.com/tianocore/edk2
$git clone https://github.com/tianocore/edk2
Continue to Compile Tools and then BUILD sections
- Create a workspace directory
- Change to the workspace directory
- Clone the EDK II project repository (See Download section above)
- Example: git clone https://github.com/tianocore/edk2
- Install Python37 or late version (https://www.python.org/) to run python tool from source
- Compile BaseTools C source tools
- Inside Git Bash
$ git clone https://github.com/tianocore/edk2
Example:
- Open Command prompt and CD C:\edk2:
C:\edk2> set PYTHON_HOME=C:\Python37 C:\edk2> edksetup.bat Rebuild
- Set up the Nasm open source assembly compiler
- Set up the ASL Compiler
- Compile Tools above
- Open a Windows CMD prompt:
- Change to the edk2 directory
- Run the edksetup.bat script
C:\Users\MySid> CD \edk2 C:\edk2> edksetup
You will need to edit the Conf\target.txt file. First, change the ACTIVE_PLATFORM to the MdeModulePkg:
C:\edk2> notepad Conf\target.txt
ACTIVE_PLATFORM should look like this in Conf\target.txt:
ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
Modify TOOL_CHAIN_TAG in target.txt for the toolchain installed on your system. There are many options, so review the tools_def.txt to find the appropriate toolchain for your system. Search for 'Supported Tool Chains' in tools_def.txt to see the valid options for TOOL_CHAIN_TAG.
TOOL_CHAIN_TAG = VS2015x86
See also: Windows-systems-ToolChain-Matrix for how to change the Tool Chain Tag.
Also, consider if you want to build a different processor architecture by changing the TARGET_ARCH value in target.txt. Please consider that certain toolchains only support building certain processor architectures.
Now you should be able to simply run the build command to compile the MdeModulePkg.
C:\edk2> build
As a tangible result of the build, you should have the HelloWorld UEFI application. If you have a UEFI system available to you which matches the processor architecture that you built, then this application should be able to run successfully under the shell.
C:\edk2> dir /s Build\MdeModule\DEBUG_...\IA32\HelloWorld.efi
Build OVMF (OPTIONAL)
Once your build environment is set up you might be interested in building the OVMF platform which is included in the main edk2 source tree. Since OVMF builds a full system firmware image this may be of interest to UEFI system firmware developers.
Home
Getting Started with EDK II
Build Instructions
EDK II Platforms
EDK II Documents
EDK II Release Planning
Reporting Issues
Reporting Security Issues
Community Information
Inclusive Language
Additional Projects & Tasks
Training
Community Support
Community Virtual Meetings
GHSA GitHub Security Advisories Proceess (Draft)