This dir provides code to build kvm-unit-tests test cases and run them under QEMU and UEFI.
The following dependencies should be installed:
To build:
./configure --target-efi make
To run a test case with UEFI:
./x86/efi/run ./x86/msr.efi
By default the runner script loads the UEFI firmware /usr/share/ovmf/OVMF.fd
; please install UEFI firmware to this path, or specify the correct path through the env variable EFI_UEFI
:
EFI_UEFI=/path/to/OVMF.fd ./x86/efi/run ./x86/msr.efi
This dir contains source code and linker script copied from GNU-EFI:
EFI application binaries should be relocatable as UEFI loads binaries to dynamic runtime addresses. To build such relocatable binaries, GNU-EFI utilizes the above-mentioned files in its build process:
elf_x86_64_efi.lds
to organize the sections in a way UEFI recognizesreloc_x86_64.c
that applies dynamic relocations that may be present in the shared objectcrt0-efi-x86_64.S
that invokes self-relocator and then jumps to EFI application's efi_main()
functionMore details can be found in GNU-EFI/README.gnuefi
, section “Building Relocatable Binaries”.
kvm-unit-tests follows a similar build process, but does not link with GNU-EFI library.
This dir also contains kvm-unit-tests startup code in UEFI: