Building drivers

There are three types of UEFI images:

  • Application
  • Boot service driver
  • Runtime driver

By default, Rust's UEFI targets produce applications. This can be changed by passing a subsystem linker flag in rustflags and setting the value to efi_boot_service_driver or efi_runtime_driver.

Example:

# In .cargo/config.toml:
[build]
rustflags = ["-C", "link-args=/subsystem:efi_runtime_driver"]