Giter Club home page Giter Club logo

uefi-rs's Introduction

uefi-rs

This library allows you to write UEFI applications in Rust.

UEFI is the successor to the BIOS. It provides an early boot environment for OS loaders and other low-level applications.

The objective of this library is to provide safe and performant wrappers for UEFI interfaces, and allow developers to write idiomatic Rust code.

Crates

This project contains multiple sub-crates:

  • uefi (top directory): contains wrappers around the UEFI interfaces.

  • uefi-services: initializes many convenience crates:

    • uefi-logger: wrapper for the standard logging crate.
    • uefi-alloc: wrapper for the memory allocation functions. This allows you to allocate objects on the heap.
  • uefi-utils: building on top of uefi-services, this crate provides a higher-level access to UEFI functions. Provides utility functions for common API usage.

  • tests: a sample UEFI applications that runs unit tests.

Documentation

This crate's documentation is fairly minimal, and you are encouraged to refer to the UEFI specification for detailed information.

You can find some example code in the tests directory, as well as use the build.py script to generate the documentation.

This repo also contains a x86_64-uefi.json file, which is a custom Rust target for 64-bit UEFI applications.

Building UEFI programs

Prerequisites

  • Xargo: this is essential if you plan to do any sort of cross-platform / bare-bones Rust programming.
  • LLD: this linker is now shipped with the latest nightly!

Steps

The following steps allow you to build a simple UEFI app.

  • Create a new #![no_std] binary, add #![no_main] to use a custom entry point, and make sure you have an entry point function which matches the one below:
#[no_mangle]
pub extern "C" fn uefi_start(handle: Handle, system_table: &'static table::SystemTable) -> Status;
  • Copy the tests/x86_64-uefi.json target file to your project's root. You can customize it.

  • Build using xargo build --target x86_64-uefi.

  • The target directory will contain a x86_64-uefi subdirectory, where you will find the uefi_app.efi file - a normal UEFI executable.

You can use the tests directory as sample code for building a simple UEFI app.

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.

uefi-rs's People

Contributors

fredrikaleksander avatar gabrielmajeri avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.