rust-osdev / uefi-rs

Rust wrapper for UEFI.
https://rust-osdev.com/uefi-book
Mozilla Public License 2.0
1.23k stars 155 forks source link
osdev rust uefi

uefi-rs

Crates.io Docs.rs License Build status Stars

Description

UEFI started as the successor firmware to the BIOS in x86 space and developed to a universal firmware specification for various platforms, such as ARM. It provides an early boot environment with a variety of specified ready-to-use "high-level" functionality, such as accessing disks or the network. EFI images, the files that can be loaded by an UEFI environment, can leverage these abstractions to extend the functionality in form of additional drivers, OS-specific bootloaders, or different kind of low-level applications.

Our mission is to provide safe and performant wrappers for UEFI interfaces, and allow developers to write idiomatic Rust code.

This repository provides various crates:

You can use the abstractions for example to:

All crates are compatible with all platforms that both the Rust compiler and UEFI support, such as i686, x86_64, and aarch64). Please note that we can't test all possible hardware/firmware/platform combinations.

UEFI App running in QEMU Screenshot of an application running in QEMU on an UEFI firmware that leverages our Rust library.

User Documentation

For a quick start, please check out the UEFI application template.

The uefi-rs book contains a tutorial, how-tos, and overviews of some important UEFI concepts. Reference documentation for the various crates can be found on docs.rs:

For additional information, refer to the UEFI specification.

MSRV

See the uefi package's README.

Developer Guide

Project structure

This project contains multiple sub-crates:

Building and testing uefi-rs

Use the cargo xtask command to build and test the crate.

Available commands:

The uefi-test-runner directory contains a sample UEFI app which exercises most of the library's functionality.

Check out the testing project's README.md for prerequisites for running the tests.

Contributing

We welcome issues and pull requests! For instructions on how to set up a development environment and how to add new protocols, check out CONTRIBUTING.md.

License

The code in this repository is licensed under the Mozilla Public License 2. This license allows you to use the crate in proprietary programs, but any modifications to the files must be open-sourced.

The full text of the license is available in the license file.