Framework for writing UEFI application
The types in this crate do not yet wrap the entirety of the UEFI spec. Currently
only a subset of UEFI functions are defined. Some types (SystemTable
) for
example allow you access lower layers though (via the bits()
method).
This is a hello world application using efw:
#![no_std]
#![no_main]
#[macro_use] extern crate efw;
#[no_mangle]
fn efw_main() {
println!("Hello, world!");
}
efw
reexports the contents of the alloc
crate so you can use dynamic memory allocation:
#![no_std]
#![no_main]
#[macro_use] extern crate efw;
#[no_mangle]
fn efw_main() {
let vector = vec![1, 2, 3];
println!("Allocated vector: {:?}", vector);
}
To be able to use cargo build
to build the applications you should add the following to .cargo/config.toml
:
[unstable]
build-std = ["core", "compiler_builtins", "alloc"]
build-std-features = ["compiler-builtins-mem"]
efw provides a set of predefined protocols that are needed for it to function
properly. You can extend the set of protocols though by implementing the
Protocol
trait. That trait provides methods for finding handles supporting
the protocol.