All Projects → rust-osdev → Uefi Rs

rust-osdev / Uefi Rs

Licence: mpl-2.0
Rust wrapper for UEFI.

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Uefi Rs

biefircate
Running x86-16 or x86-32 code from x86-64 UEFI; _very experimental_ • mirror of https://gitlab.com/tkchia/biefircate • developer notes at https://gitlab.com/tkchia/biefircate/-/blob/main/doc/NOTES.asciidoc
Stars: ✭ 47 (-91.92%)
Mutual labels:  osdev, uefi
uefi-elf-bootloader
UEFI ELF Bootloader example
Stars: ✭ 40 (-93.13%)
Mutual labels:  osdev, uefi
Tofita
🍬 All-new kernel for @GreenteaOS
Stars: ✭ 112 (-80.76%)
Mutual labels:  uefi, osdev
SnowFlake
Technology is free, SnowFlakeOS
Stars: ✭ 38 (-93.47%)
Mutual labels:  osdev, uefi
Aquila
AquilaOS: UNIX-like Operating System
Stars: ✭ 413 (-29.04%)
Mutual labels:  osdev
S6 pcie microblaze
PCI Express DIY hacking toolkit for Xilinx SP605
Stars: ✭ 301 (-48.28%)
Mutual labels:  uefi
Lumia950xlpkg
Non-EOL (yes!) AArch64 UEFI firmware for Lumia 950 / Lumia 950 XL
Stars: ✭ 300 (-48.45%)
Mutual labels:  uefi
Efifs
EFI FileSystem drivers
Stars: ✭ 272 (-53.26%)
Mutual labels:  uefi
Nanos
A kernel designed to run one and only one application in a virtualized environment
Stars: ✭ 557 (-4.3%)
Mutual labels:  osdev
Rpi4
Raspberry Pi 4 UEFI Firmware Images [EXPERIMENTAL]
Stars: ✭ 480 (-17.53%)
Mutual labels:  uefi
Uefi Ntfs
UEFI:NTFS - Boot NTFS partitions from UEFI
Stars: ✭ 386 (-33.68%)
Mutual labels:  uefi
Super Uefiinsecureboot Disk
Super UEFIinSecureBoot Disk: Boot any OS or .efi file without disabling UEFI Secure Boot
Stars: ✭ 309 (-46.91%)
Mutual labels:  uefi
Gramado
Gramado OS - 32bit operating system
Stars: ✭ 420 (-27.84%)
Mutual labels:  osdev
Aio Boot
AIO Boot is an All-in-One bootable software for USB and HDD. Is one of the best Multiboot USB Creator for Windows.
Stars: ✭ 300 (-48.45%)
Mutual labels:  uefi
Os67
An unix-like toy kernel
Stars: ✭ 531 (-8.76%)
Mutual labels:  osdev
Minivisorpkg
The research UEFI hypervisor that supports booting an operating system.
Stars: ✭ 294 (-49.48%)
Mutual labels:  uefi
Wingos
a little 64bit operating system written in c++ with smp support
Stars: ✭ 361 (-37.97%)
Mutual labels:  osdev
Powernex
An operating system written in D
Stars: ✭ 460 (-20.96%)
Mutual labels:  osdev
Grub2 Filemanager
GRUB2-based file manager
Stars: ✭ 330 (-43.3%)
Mutual labels:  uefi
Toaruos
A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
Stars: ✭ 4,687 (+705.33%)
Mutual labels:  osdev

uefi-rs

Crates.io Docs.rs Stars License Build status

Description

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

This crate makes it easy to both:

  • Write UEFI applications in Rust (for x86_64 or aarch64)
  • Call UEFI functions from an OS (usually built with a custom target)

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

Check out @gil0mendes blog post on getting started with UEFI in Rust.

Note: this crate currently has only been tested with 64-bit UEFI on x86/ARM.

uefi-rs running in QEMU

Project structure

This project contains multiple sub-crates:

  • uefi (top directory): defines the standard UEFI tables / interfaces. The objective is to stay unopionated and safely wrap most interfaces.

    Optional features:

    • alloc: implements a global allocator using UEFI functions.
      • This allows you to allocate objects on the heap.
      • There's no guarantee of the efficiency of UEFI's allocator.
    • logger: logging implementation for the standard log crate.
      • Prints output to console.
      • No buffering is done: this is not a high-performance logger.
    • exts: extensions providing utility functions for common patterns.
      • Requires the alloc crate (either enable the alloc optional feature or your own custom allocator).
  • uefi-macros: procedural macros that are used to derive some traits in uefi.

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

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

Building kernels which use UEFI

This crate makes it easy to start building simple applications with UEFI. However, there are some limitations you should be aware of:

  • The global logger / allocator can only be set once per binary. It is useful when just starting out, but if you're building a real OS you will want to write your own specific kernel logger and memory allocator.

  • To support advanced features such as higher half kernel and linker scripts you will want to build your kernel as an ELF binary.

In other words, the best way to use this crate is to create a small binary which wraps your actual kernel, and then use UEFI's convenient functions for loading it from disk and booting it.

This is similar to what the Linux kernel's EFI stub does: the compressed kernel is an ELF binary which has little knowledge of how it's booted, and the boot loader uses UEFI to set up an environment for it.

Documentation

The docs for the latest published crate version can be found at docs.rs/uefi/

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

Sample code

An example UEFI app is built in the uefi-test-runner directory.

Check out the testing README.md for instructions on how to run the crate's tests.

Building UEFI programs

For instructions on how to create your own UEFI apps, see the BUILDING.md file.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].