Windows systems

Laurie Jarlstrom edited this page Nov 23, 2016 · 5 revisions
Clone this wiki locally

This page provides step-by-step instructions or setting up a EDK II build environment on Windows systems.

Table of Contents

GitHub Help

GitHub (https://help.github.com/index.html) provides step-by-step instructions for user registration and basic features supported by GitHub.

Git GUI Interface for Windows OS

GitHub EDK II Project Repositories

Content that is not released under an accepted open source license can be found at https://github.com/tianocore/edk2-non-osi.

Internet proxies

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>

How to Setup the EDK II Tree

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

Download/Checkout the EDK II source tree from Github

Download Using a Web browser

  1. Download EDK II Project
    1. Open https://github.com/tianocore/edk2 in web browser
    2. Click on the Clone or Download button (Right Green)
    3. Click on Download ZIP
    4. Unzip to C:/
    5. Rename directory “edk2-master” to “edk2”
  2. Download the EDK II Base Tools
    1. Open https://github.com/tianocore/edk2-BaseTools-win32 in web browser
    2. Click on the Clone or Download button (Right Green)
    3. Click on Download ZIP
    4. Unzip to C:/
    5. Rename directory “edk2-BaseTools-win32-master” to “Win32”
    6. Copy C:/Win32 to C:/edk2/BaseTools/Bin
Continue to BUILD section

Using Git for Windows Application

Git GUI

  1. Clone the EDK II project repository
    1. Open Git GUI
    2. Use Clone Exiting Repository with Source location https://github.com/tianocore/edk2.git
    3. Select a Target directory C:/edk2
    4. Check Recursively clone submodules too
    5. click Clone button
  2. Repeat the above with the Clone the edk2-BaseTools-win32 repository repository
    1. Open Git Gui
    2. Use Clone Exiting Repository with Source location https://github.com/tianocore/edk2.git and Target directory C:/Win32
  3. Copy C:/Win32 to C:/edk2/BaseTools/Bin
Continue to BUILD section

Git CMD

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
For EDK II project developers on Windows:
Example:
  • Inside Git Bash
     $ git clone https://github.com/tianocore/edk2
     $ git clone https://github.com/tianocore/edk2-BaseTools-win32
  • Windows CMD prompt:
     C:\edk2> set EDK_TOOLS_BIN=c:\efi\test\edk2-BaseTools-win32

When the above steps are done, the directory structure will look like:

  efi
    └───test (WORKSPACE)
       ├───edk2
       └───edk2-BaseTools-win32

Build

  • Set up the Nasm open source assembly compiler
  • Set up the ASL Compiler
  • Open a Windows CMD prompt:
  • Change to the edk2 directory
  • Run the edksetup.bat script
      C:\Users\MySid> CD \edk2
      C:\edk2> edksetup

Build MdeModulePkg

Modify Conf files

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        = VS2008x86

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.

Build Hello World! (and the rest of MdeModulePkg)

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\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.

See Also