#helper #uefi #mu #applications #function #repo #target

mu_rust_helpers

Helper functions for UEFI Rust applications

1 stable release

new 2.0.0 Jan 15, 2025

#563 in Hardware support

BSD-2-Clause-Patent

100KB
1K SLoC

Mu Rust Helpers

Project Mu Rust UEFI helper code.

Most Project Mu Rust repos contain an individual feature. This repo contains code that provides helper functionality for UEFI Rust code. The repo is composed of separate crates for different purposes. Therefore, the code maintained in this repo may overall be less cohesive than other repos.

Current State

This repository is in the early stages of development. The crate is not complete and should not be used in production at this time. Major changes to the API may occur. We are interested in feedback and contributions and we want the flexibility to make changes as needed.

Requirements

rustc Version

Build

cargo build

Build with Official Toolchains

These instructions are derived from those in r-efi.

Starting with rust-version 1.68, rustup distributes pre-compiled toolchains for many UEFI targets. You can enumerate and install them via rustup. This example shows how to enumerate all available targets for your stable toolchain and then install the UEFI target for the x86_64 architecture:

rustup target list --toolchain=stable
rustup target add --toolchain=stable x86_64-unknown-uefi

This project can then be compiled directly for the selected target:

cargo +stable build --lib --target x86_64-unknown-uefi

Build via Foreign Targets

The project can be built for non-UEFI targets via the standard rust toolchains. This allows non-UEFI targets to interact with UEFI systems or otherwise host UEFI operations. Furthermore, this allows running the foreign test-suite of this project as long as the target supports the full standard library:

cargo +stable build --all-targets
cargo +stable test --all-targets

Test

cargo test

Contributing

Contributions are always welcome and encouraged!

Please run the following commands before creating a pull request:

  • >cargo fmt
  • >cargo test --all
    • Verify tests pass.
  • >cargo doc --open
    • Verify documentation appearance.

Guidance and requirements:

Issues

Please open any issues in the issues section.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct.

For more information see the Code of Conduct FAQ or contact opencode@microsoft.com. with any additional questions or comments.

  • Copyright (c) Microsoft Corporation
  • SPDX-License-Identifier: BSD-2-Clause-Patent

Dependencies

~0–320KB