rust-osdev/uefi-rs

Rustrust-osdev.com/uefi-book

Rusty wrapper for the Unified Extensible Firmware Interface (UEFI). This crate makes it easy to develop Rust software that leverages safe, convenient, and performant abstractions for UEFI functionality.

uefirustosdev
Star 增长趋势
Star
1.6k
Forks
201
周增长
+0
Issues
31
5001k1.5k
2023年1月2024年3月2025年6月2026年9月
制品库crates.io
README

uefi-rs

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

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

API and User Documentation

The main contribution of this project is the uefi crate. 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.

Developer Guide

Repository Structure

This repository provides various crates:

  • uefi: High-level wrapper around various low-level UEFI APIs. This crate makes it easy to develop Rust software that leverages safe, convenient, and performant abstractions for UEFI functionality. This is the main contribution of this project.
  • uefi-raw: Raw ABI-compatible types that closely match the definitions in the UEFI Specification. They are suitable for implementing UEFI firmware or creating interfaces to it.
  • uefi-macros: Helper macros used by uefi.
  • uefi-test-runner: A UEFI application that runs our integration tests.
  • uefi-std-example: Example UEFI app but as Rust standard binary.

Building and testing uefi-rs

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

Available commands:

  • build: build all the UEFI packages
    • --release: build in release mode
    • --target {x86_64,ia32,aarch64}: choose target UEFI arch
  • clippy: run clippy on all the packages
    • --target {x86_64,ia32,aarch64}: choose target UEFI arch
    • --warnings-as-errors: treat warnings as errors
  • doc: build the docs for the UEFI packages
    • --open: open the docs in a browser
    • --warnings-as-errors: treat warnings as errors
  • run: build uefi-test-runner and run it in QEMU
    • --ci: disable some tests that don't work in the CI
    • --disable-kvm: disable hardware accelerated virtualization support in QEMU. Especially useful if you want to run the tests under WSL on Windows.
    • --example <NAME>: run an example instead of the main binary.
    • --headless: run QEMU without a GUI
    • --ovmf-code <PATH>: path of an OVMF code file
    • --ovmf-vars <PATH>: path of an OVMF vars file
    • --release: build in release mode
    • --target {x86_64,ia32,aarch64}: choose target UEFI arch
  • test: run unit tests and doctests on the host

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.

Showcases

Selected showcases from community. Feel free to raise a PR and add yours!

  • ratatuefi provides a Ratatui backend for the UEFI environment using uefi.
  • efimux is an EFI application for booting other EFI applications, written with the aforementioned ratatuefi and therefore also uefi.
  • uefirc is a graphical UEFI IRC client to connect to an IRC server, chat, and read messages, all from the comfort of your motherboard's pre-boot environment.

Discuss and Contribute

For general discussions, feel free to join us in our Zulip and ask your questions there.

Further, you can submit bugs and also ask questions in our [issue tracker]. Contributions in the form of a PR are also highly welcome. Check our contributing guide for details.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

相关仓库
ventoy/Ventoy

A new bootable USB solution.

CappGNU General Public License v3.0bootable-usbmultiboot
ventoy.net
79.2k4.9k
pbatard/rufus

The Reliable USB Formatting Utility

CGNU General Public License v3.0usbiso
rufus.ie
37.6k3.2k
CTCaer/hekate

hekate - A GUI based Nintendo Switch Bootloader

CGNU General Public License v2.0nintendo-switch-bootloaderbootloader
8.7k680
tianocore/edk2

EDK II

COthercpython
tianocore.org/tianocore-wiki.github.io/
6.2k3.3k
qilingframework/qiling

A True Instrumentable Binary Emulation Framework

PythonPyPIlibraryGNU General Public License v2.0binaryemulator
qiling.io
6.1k795
armbian/build

The official build framework for the Armbian Linux distribution. This repository contains the complete toolchain and scripts required to compile custom OS images from source, including kernel configuration, U-Boot handling, and board-specific tweaks for various ARM and ARM64 single-board computers.

ShelllibraryGNU General Public License v2.0kernel-compilationarm
armbian.com
5.4k3.1k
TechUnRestricted/WinDiskWriter

🖥 Windows Bootable USB creator for macOS. 🛠 Patches Windows 11 to bypass TPM and Secure Boot requirements. 👾 UEFI & Legacy Support

CappGNU General Public License v3.0bootable-usbfat32
4.7k139
Limine-Bootloader/Limine

Modern, secure, portable, multiprotocol bootloader and boot manager.

CBSD 2-Clause "Simplified" Licensebootloaderbios
3.7k223
limine-bootloader/limine

Modern, advanced, portable, multiprotocol bootloader and boot manager.

CBSD 2-Clause "Simplified" Licensebootloaderbios
limine-bootloader.org
3.7k222
vvaltchev/tilck

A Tiny Linux-Compatible Kernel

CBSD 2-Clause "Simplified" Licensex86kernel
3.1k140
Metabolix/HackBGRT

Windows boot logo changer for UEFI systems

C#MIT Licenseuefiboot-logo-changer
2.9k286
pbatard/Fido

A PowerShell script to download Windows or UEFI Shell ISOs

PowerShellcliGNU General Public License v3.0isowindows
2.9k256