Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rust wrapper for UEFI.

License

NotificationsYou must be signed in to change notification settings

rucoder/uefi-rs

 
 

Repository files navigation

Crates.ioDocs.rsStarsLicenseBuild status

Description

UEFI is the successor to the BIOS. It provides an early boot environment forOS loaders, hypervisors and other low-level applications. While it started outas x86-specific, it has been adopted on other platforms, such as ARM.

This crate makes it easy to both:

  • Write UEFI applications in Rust (fori686,x86_64, oraarch64)
  • Call UEFI functions from an OS (usually built with acustom target)

The objective is to providesafe andperformant wrappers for UEFI interfaces,and allow developers to write idiomatic Rust code.

Check outthe UEFI application template for a quick start.

uefi-rs running in QEMU

Project structure

This project contains multiple sub-crates:

  • uefi: defines the standard UEFI tables / interfaces.The objective is to stay unopinionated and safely wrap most interfaces.

  • uefi-macros: procedural macros that are used to derive some traits inuefi.

  • uefi-raw: raw types that closely match the definitions in the UEFISpecification. Safe wrappers for these types are provided by theueficrate. The raw types are suitable for implementing UEFI firmware.

  • uefi-services: provides a panic handler, and initializes thealloc /logger features.

  • uefi-test-runner: a UEFI application that runs unit / integration tests.

Documentation

Theuefi-rs book contains a tutorial, how-tos, and overviews of someimportant UEFI concepts.

Reference documentation can be found on docs.rs:

For additional information, refer to theUEFI specification.

Building and testing uefi-rs

Use thecargo 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: builduefi-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 underWSL 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

Theuefi-test-runner directory contains a sample UEFI app which exercisesmost of the library's functionality.

Check out the testing project'sREADME.md forprerequisites for running the tests.

MSRV

See theuefi package's README.

Contributing

We welcome issues and pull requests! For instructions on how to set up a developmentenvironment and how to add new protocols, check outCONTRIBUTING.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 thelicense file.

About

Rust wrapper for UEFI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust99.3%
  • Other0.7%

[8]ページ先頭

©2009-2025 Movatter.jp