Crate uefi_services

source ·
Expand description

This crate simplifies the writing of higher-level code for UEFI.

It initializes the memory allocation and logging crates, allowing code to use Rust’s data structures and to log errors.

Logging and allocation are only allowed while boot services are active. Once runtime services are activated by calling exit_boot_services, the logger will be disabled and the allocator will always return null.

It also stores a global reference to the UEFI system table, in order to reduce the redundant passing of references to it.

Library code can simply use global UEFI functions through the reference provided by system_table.

§Optional crate features

  • logger (enabled by default): Initialize a global logger.
  • panic_handler (enabled by default): Register a panic handler. A panic handler must be provided for your program to compile, but you can choose to provide your own if you don’t want to use this one.
  • qemu: On x86_64, make qemu exit with code 3 if a panic occurs. This feature assumes the program is running under QEMU.

Macros§

  • Prints to the standard output.
  • Prints to the standard output, with a newline.

Functions§

  • Initialize the UEFI utility library.
  • Obtains a pointer to the system table.