Getting the UEFI Development Kit (UDK) installed and building is the first step in attempting to work in BIOS development.  Here is my experience getting the latest version of the UDK, UDK 2014, to work in Windows.

Step 1Download UDK 2014 (101MB)

Step 2:  The main .ZIP is a collection of .ZIPs.  First, extract UDK2014.MyWorkSpace.zip.

Step 3:  This is tricky:  you next have to unzip BaseTools(Windows).zip, and it has to be put in a subdirectory of the MyWorkSpace directory from Step 2.  The “BaseTools” directory should be at a peer level to Build, Conf, CryptoPkg, etc.  Note that this will entail overwriting several files, e.g., EDKSETUP.BAT—this is okay.  The final directory structure should look like:

    MyWorkSpace

        -->BaseTools

        -->Build

        -->Conf

        etc.

Step 4:  Open a Command Prompt and cd to MyWorkSpace\.  Type the command

edksetup --NT32

to initialize the build environment.

Step 5:  Build the virtual BIOS environment:

> build -t VS2008x86 for Visual Studio 2008

> build -t VS2010x86 for Visual Studio 2010

Step 6:  Launch SECMAIN.EXE from the directory:

Build\NT32IA32\DEBUG_VS2010x86\IA32

imageA virtual machine will start and you will boot to an EFI shell.  Type “help” for a list of commands—see Harnessing the UEFI Shell (below) for more information re: the UEFI shell.  Congratulations, at this point you are ready to develop PEI modules and DXE drivers!

That is the absolute minimum work necessary to boot to the NT32 virtual machine.  There is additional information in the file UDK2014-ReleaseNotes-MyWorkSpace.txt, which is included in MyWorkSpace\.

 

Post a Comment

  1. This is a great quick-start

    ReplyDelete
  2. That's so helpful to start uEFI.

    ReplyDelete
  3. In Step 6, EDKII use "build run" to run the SHELL, what's different with yours?

    ReplyDelete
    Replies
    1. Hi Wario, thanks for the comment! When I try that I get the error:
      build...
      : error 7000: Failed to start command
      C:\Program Files\Microsoft Visual Studio 9.0\Vc\bin\nmake.exe /nologo run [c:\users\williamleara\src\myworkspace\Build\NT32IA32\DEBUG_MYTOOLS]

      - Failed -
      Build end time: 17:24:20, Aug.26 2014
      Build total time: 00:00:04

      I noticed that "build run" seems to assume Visual Studio 9.0 (also called Visual Studio 2008) which I don't have on my system--perhaps "build run" would work if I had VS2008 installed. With the "-t" switch passed to the build command, the user can specify the tool chain. The list of all the possible tool chains can be found in Conf\tools_def.txt. I also tried "build run -t VS2010x86", but got an error telling me SecMain could not be found. Anyway, I think the "build run" target must require some configuration not setup in the UDK by default.

      Delete
  4. Take a look at edksetup.bat, search for "nt32". There's a comment that says "The Nt32 Emulation Platform requires Microsoft Libraries and headers to interface with Windows", and it looks for various versions of Visual Studio. If you don't have a supported/recognized version of Visual Studio installed, you should get an error when you run "edksetup.bat --nt32" saying "!!! WARNING !!! Cannot find Visual Studio !!!"

    ReplyDelete
  5. In UDK2014, "build run" resolves to:
    cd $(BUILD_DIR)${separator}IA32 && ".${separator}SecMain"
    cd $(BUILD_DIR)
    (see BaseTools\Source\Python\AutoGen\GenMake.py, or the resulting makefile in your build directory)
    William's Step 6 tells you to do the same thing manually.

    ReplyDelete

Be sure to select an account profile (e.g. Google, OpenID, etc.) before typing your comment!