VirtualBox

Ignore:
Timestamp:
Mar 12, 2019 12:40:12 PM (6 years ago)
Author:
vboxsync
Message:

EFI: First step in UDK2018 merge. Does not build yet.

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/README

    r58459 r77662  
    66code base.  More information can be found at:
    77
    8 http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=OVMF
     8http://www.tianocore.org/ovmf/
    99
    1010=== STATUS ===
     
    5656More information on building OVMF can be found at:
    5757
    58 http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=How_to_build_OVMF
     58https://github.com/tianocore/tianocore.github.io/wiki/How%20to%20build%20OVMF
    5959
    6060=== RUNNING OVMF on QEMU ===
     
    6767    * QEMU/OVMF will use emulated flash, and fully support UEFI variables
    6868    * Run qemu with: -pflash path/to/OVMF.fd
     69    * Note that this option is required for running SecureBoot-enabled builds
     70      (-D SECURE_BOOT_ENABLE).
    6971  - Option 2: Use QEMU -bios parameter
    7072    * Note that UEFI variables will be partially emulated, and non-volatile
     
    117119$ OvmfPkg/build.sh -a IA32 -b RELEASE -t GCC45
    118120
     121=== SMM support ===
     122
     123Requirements:
     124* SMM support requires QEMU 2.5.
     125* The minimum required QEMU machine type is "pc-q35-2.5".
     126* SMM with KVM requires Linux 4.4 (host).
     127
     128OVMF is capable of utilizing SMM if the underlying QEMU or KVM hypervisor
     129emulates SMM. SMM is put to use in the S3 suspend and resume infrastructure,
     130and in the UEFI variable driver stack. The purpose is (virtual) hardware
     131separation between the runtime guest OS and the firmware (OVMF), with the
     132intent to make Secure Boot actually secure, by preventing the runtime guest OS
     133from tampering with the variable store and S3 areas.
     134
     135For SMM support, OVMF must be built with the "-D SMM_REQUIRE" option. The
     136resultant firmware binary will check if QEMU actually provides SMM emulation;
     137if it doesn't, then OVMF will log an error and trigger an assertion failure
     138during boot (even in RELEASE builds). Both the naming of the flag (SMM_REQUIRE,
     139instead of SMM_ENABLE), and this behavior are consistent with the goal
     140described above: this is supposed to be a security feature, and fallbacks are
     141not allowed. Similarly, a pflash-backed variable store is a requirement.
     142
     143QEMU should be started with the options listed below (in addition to any other
     144guest-specific flags). The command line should be gradually composed from the
     145hints below. '\' is used to extend the command line to multiple lines, and '^'
     146can be used on Windows.
     147
     148* QEMU binary and options specific to 32-bit guests:
     149
     150  $ qemu-system-i386 -cpu coreduo,-nx \
     151
     152  or
     153
     154  $ qemu-system-x86_64 -cpu <MODEL>,-lm,-nx \
     155
     156* QEMU binary for running 64-bit guests (no particular options):
     157
     158  $ qemu-system-x86_64 \
     159
     160* Flags common to all SMM scenarios (only the Q35 machine type is supported):
     161
     162  -machine q35,smm=on,accel=(tcg|kvm) \
     163  -m ... \
     164  -smp ... \
     165  -global driver=cfi.pflash01,property=secure,value=on \
     166  -drive if=pflash,format=raw,unit=0,file=OVMF_CODE.fd,readonly=on \
     167  -drive if=pflash,format=raw,unit=1,file=copy_of_OVMF_VARS.fd \
     168
     169* In order to disable S3, add:
     170
     171  -global ICH9-LPC.disable_s3=1 \
     172
    119173=== Network Support ===
    120174
     
    171225
    172226* Also independently of the iPXE NIC drivers, Intel's proprietary E1000 NIC
    173   driver (PROEFI) can be embedded in the OVMF image at build time:
    174 
    175   - Download UEFI drivers for the e1000 NIC
    176     - http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=17515&lang=eng
    177     - Install the drivers into a directory called Intel3.5 in your WORKSPACE.
     227  driver (from the BootUtil distribution) can be embedded in the OVMF image at
     228  build time:
     229
     230  - Download BootUtil:
     231    - Navigate to
     232      https://downloadcenter.intel.com/download/19186/Ethernet-Intel-Ethernet-Connections-Boot-Utility-Preboot-Images-and-EFI-Drivers
     233    - Click the download link for "PREBOOT.EXE".
     234    - Accept the Intel Software License Agreement that appears.
     235    - Unzip "PREBOOT.EXE" into a separate directory (this works with the
     236      "unzip" utility on platforms different from Windows as well).
     237    - Copy the "APPS/EFI/EFIx64/E3522X2.EFI" driver binary to
     238      "Intel3.5/EFIX64/E3522X2.EFI" in your WORKSPACE.
     239    - Intel have stopped distributing an IA32 driver binary (which used to
     240      match the filename pattern "E35??E2.EFI"), thus this method will only
     241      work for the IA32X64 and X64 builds of OVMF.
    178242
    179243  - Include the driver in OVMF during the build:
    180     - Add "-D E1000_ENABLE -D FD_SIZE_2MB" to your build command,
    181     - For example: "build -D E1000_ENABLE -D FD_SIZE_2MB".
     244    - Add "-D E1000_ENABLE" to your build command (only when building
     245      "OvmfPkg/OvmfPkgIa32X64.dsc" or "OvmfPkg/OvmfPkgX64.dsc").
     246    - For example: "build -D E1000_ENABLE".
    182247
    183248* When a matching iPXE driver is configured for a NIC as described above, it
    184249  takes priority over other drivers that could possibly drive the card too:
    185250
    186                  | e1000  ne2k_pci  pcnet  rtl8139  virtio-net-pci
    187     -------------+------------------------------------------------
    188     iPXE         |   x       x        x       x           x
    189     VirtioNetDxe |                                        x
    190     Intel PROEFI |   x
     251                         | e1000  ne2k_pci  pcnet  rtl8139  virtio-net-pci
     252    ---------------------+------------------------------------------------
     253    iPXE                 |   x       x        x       x           x
     254    VirtioNetDxe         |                                        x
     255    Intel BootUtil (X64) |   x
    191256
    192257=== OVMF Flash Layout ===
    193258
    194 Like all current IA32/X64 system designs, OVMF's firmware
    195 device (rom/flash) appears in QEMU's physical address space
    196 just below 4GB (0x100000000).
    197 
    198 The layout of the firmware device in memory looks like:
     259Like all current IA32/X64 system designs, OVMF's firmware device (rom/flash)
     260appears in QEMU's physical address space just below 4GB (0x100000000).
     261
     262OVMF supports building a 1MB, 2MB or 4MB flash image (see the DSC files for the
     263FD_SIZE_1MB, FD_SIZE_2MB, FD_SIZE_4MB build defines). The base address for the
     2641MB image in QEMU physical memory is 0xfff00000. The base address for the 2MB
     265image is 0xffe00000. The base address for the 4MB image is 0xffc00000.
     266
     267Using the 1MB or 2MB image, the layout of the firmware device in memory looks
     268like:
    199269
    200270+--------------------------------------- 4GB (0x100000000)
    201271| VTF0 (16-bit reset code) and OVMF SEC
    202 | (SECFV)
     272| (SECFV, 208KB/0x34000)
    203273+--------------------------------------- varies based on flash size
    204274|
     
    218288+--------------------------------------- base address
    219289
    220 OVMF supports building a 1MB or a 2MB flash image. The base address for
    221 a 1MB image in QEMU physical memory is 0xfff00000. The base address for
    222 a 2MB image is 0xffe00000.
     290Using the 4MB image, the layout of the firmware device in memory looks like:
     291
     292+--------------------------------------- base + 0x400000 (4GB/0x100000000)
     293| VTF0 (16-bit reset code) and OVMF SEC
     294| (SECFV, 208KB/0x34000)
     295+--------------------------------------- base + 0x3cc000
     296|
     297| Compressed main firmware image
     298| (FVMAIN_COMPACT, 3360KB/0x348000)
     299|
     300+--------------------------------------- base + 0x84000
     301| Fault-tolerant write (FTW)
     302| Spare blocks (264KB/0x42000)
     303+--------------------------------------- base + 0x42000
     304| FTW Work block (4KB/0x1000)
     305+--------------------------------------- base + 0x41000
     306| Event log area (4KB/0x1000)
     307+--------------------------------------- base + 0x40000
     308| Non-volatile variable storage
     309| area (256KB/0x40000)
     310+--------------------------------------- base address (0xffc00000)
    223311
    224312The code in SECFV locates FVMAIN_COMPACT, and decompresses the
     
    237325selectively. For example:
    238326  [Components]
    239   OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf {
     327  OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf {
    240328    <BuildOptions>
    241329      GCC:*_*_*_CC_FLAGS             = -UMDEPKG_NDEBUG
    242330  }
    243   IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf {
     331  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {
    244332    <BuildOptions>
    245333      GCC:*_*_*_CC_FLAGS             = -UMDEPKG_NDEBUG
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette