mirror of
https://github.com/rust-osdev/uefi-rs
synced 2026-06-08 17:17:36 +00:00
8820a0eb58
Having these functions is very helpful if one installs multiple protocol interfaces in a driver at once. The caveat is unfortunately that Rust handling of varargs isn't very convenient. I also didn't come up with a working + nice way using normal macros to workaround. Instead, I looked into the implementation in edk2 [0]. The logic is fairly simple and can be emulated on a higher-level by us. [0] https://github.com/tianocore/edk2/blob/66346d5edeac2a00d3cf2f2f3b5f66d423c07b3e/MdeModulePkg/Core/Dxe/Hand/Handle.c#L630
uefi-test-runner
This package is a UEFI application for running tests. It is intended to
be run in a specially-configured QEMU VM. This allows us to test the
parts of the uefi package that depend on a UEFI environment, such as
various boot services and protocols.
Requirements
- QEMU: the most recent version of QEMU is recommended.
- Python 3: at least version 3.6 is required.
- OVMF:
You need to extract the firmware files into the
uefi-test-runnerdirectory.- For x86_64:
OVMF_CODE.fdandOVMF_VARS.fd - For AArch64:
QEMU_EFI-pflash.rawandvars-template-pflash.rawAlternatively, install OVMF using your distro's package manager and change the paths in the script file. Note: if your distro's OVMF version is too old / does not provide these files, you can download Gerd Hoffmann's builds and extract them in the local directory.
- For x86_64:
Build and run in QEMU
Use cargo xtask run to build uefi-test-runner and run it in QEMU. See
the top-level README for more details of cargo xtask.