uefi-rs/uefi
Philipp Schuster d76b303061 uefi: gate revision-dependent Block I/O media fields
Per spec, the EFI_BLOCK_IO_MEDIA members LowestAlignedLba and
LogicalBlocksPerPhysicalBlock are only present if the protocol
revision is at least 2, and OptimalTransferLengthGranularity only
with revision 3. The BlockIOMedia accessors read these fields
unconditionally, i.e. past the firmware-defined structure on
revision-1 implementations.

Since the media struct itself does not carry the revision, move the
three accessors to BlockIO (which does) and return None on old
revisions. They are intentionally not offered on BlockIO2: that
protocol has no revision field of its own, and the spec ties the
fields' presence to the Block I/O protocol revision.
2026-08-24 10:02:38 +02:00
..
src uefi: gate revision-dependent Block I/O media fields 2026-08-24 10:02:38 +02:00
tests uefi-raw: make MemoryDescriptor layout portable across x86 targets 2026-08-19 08:28:13 +02:00
Cargo.toml release: uefi-raw-0.15.1 and uefi-0.39.0 2026-07-11 16:09:36 -04:00
CHANGELOG.md uefi: gate revision-dependent Block I/O media fields 2026-08-24 10:02:38 +02:00
LICENSE-APACHE Add LICENSE-APACHE 2025-02-05 16:52:14 -05:00
LICENSE-MIT Add LICENSE-MIT 2025-02-05 16:52:14 -05:00
README.md doc: final streamlining of README files 2024-08-24 17:06:05 +02:00

uefi

Rusty wrapper for the Unified Extensible Firmware Interface.

This crate makes it easy to develop Rust software that leverages safe, convenient, and performant abstractions for UEFI functionality.

Crates.io Docs.rs License Build status Stars

Value-add and Use Cases

uefi supports writing code for both pre- and post-exit boot services epochs, but its true strength shines when you create UEFI images that heavily interact with UEFI boot services. Still, you have the flexibility to just integrate selected types and abstractions into your project, for example to parse the UEFI memory map.

Note that for producing UEFI images, you also need to use a corresponding uefi compiler target of Rust, such as x86_64-unknown-uefi.

API and User Documentation

Please refer to docs.rs for comprehensive documentation of the latest stable release. The latest not necessarily yet published documentation can be found in src/lib.rs, which can also be locally viewed by running $ cargo xtask doc --open.

For an introduction to the uefi-rs project and this repository, please refer to our main README.