1. Install Oracle Enterprise Linux 6.1 Server (either in a VirtualBox
   environment or into a real partition).

2. Read the instructions at "http://public-yum.oracle.com" to set up
   access from the Oracle yum repository.

   a. Download and copy the appropriate configuration file into
      /etc/yum.repos.d/, probably the one for Oracle Linux 6:

      cd /etc/yum.repos.d
      sudo wget http://public-yum.oracle.com/public-yum-ol6.repo

   b. Edit the configuration file, change 'enabled=0' to 'enabled=1'
      for one of the sections. I use ol6_u2_base, myself.  You will need
      to edit this file as root, though.

   c. If you can (re)install Firefox, then all so far is done correctly.
      Try this with the command:

      sudo yum install firefox

3. Do a full update of the system to the current repository state by running
   "Software Update" under "Administration" in the "System" menu.  You will
   probably need to do this twice before everything is fully updated.

4. Next you may need to install four additional packages:

   sudo yum install gmp-devel.x86_64
   sudo yum install mpfr-devel.x86_64
   sudo yum install iasl.x86_64
   sudo yum install libuuid-devel.x86_64

5. Download the EDK2 source code into a BIOS development directory like so:

   mkdir ~/bios
   cd ~/bios
   svn co https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2

6. Patch the mingw-gcc-build.py file with the following universal patch

   
   use http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2

7. Switch to the 'bash' shell, then configure and setup the environment
   scripts that will be used:

   bash
   make -C edk2/BaseTools
   cd edk2/BaseTools/gcc
   ./mingw-gcc-build.py --arch x64

8. Then edit the ~/bios/edk2/Conf/target.txt file to use the right tools
   and to set the default target.  Change the three lines

     ACTIVE_PLATFORM      = Nt32Pkg/Nt32Pkg.dsc
     TARGET_ARCH          = IA32
     TOOL_CHAIN_TAG       = MYTOOLS

   to

     ACTIVE_PLATFORM      = MdeModulePkg/MdeModulePkg.dsc
     TARGET_ARCH          = IA32 X64
     TOOL_CHAIN_TAG       = GCC44

9. Then do the initial build of a few files:

   cd ~/bios/edk2
   WORKSPACE=~/bios/edk2
   EDK_TOOLS_PATH=$WORKSPACE/BaseTools
   . ./edksetup.sh
   build

10. Build the OVMF BIOS for use with QEMU-KVM or VirtualBox

   build -p OvmfPkg/OvmfPkgIa32X64.dsc

11. Install qemu-kvm (probably already installed), qemu-kvm-tools and
    qemu-img.

   sudo yum install qemu-kvm.x86_64
   sudo yum install qemu-kvm-tools.x86_64
   sudo yum install qemu-img.x86_64

12. Create a virtual machine for BIOS development

   b. Build a virtual image:

      mkdir ~/bios/qemu
      cd ~/bios/qemu
      qemu-img create -f qcow2 BiosDisk.img 2G

   a. Link the new BIOS image to a file name bios.bin in the same directory
      and link the CirrusLogic5446.rom to a file name vgabios-cirrus.bin.

      ln -s ~/bios/edk2/Build/Ovmf3264/DEBUG_GCC44/FV/OVMF.fd bios.bin
      ln -s ~/bios/edk2/Build/Ovmf3264/DEBUG_GCC44/FV/OvmfVideo.rom vgabios-cirrus.bin

..................................................................
.... From here on you are on your own.  I was not able to     ....
.... run the OVMF.fd file as the BIOS image on QEMU-KVM under ....
.... Oracle Enterprise Linux. Sorry,...                       ....
..................................................................


Last modified: Thu Feb 2 08:44:37 CST 2012