A UEFI implementation written in Rust, designed as a reusable library with dependency injection for platform-specific hardware.
CrabEFI implements enough UEFI to boot Linux via shim/GRUB2 or systemd-boot on real hardware. It ships as a coreboot payload, a platform-agnostic boot library, and a separately linked Runtime Services image with bounded scratch allocation.
Graphical boot menu (--features ui), captured headlessly with
./crabefi screenshot --app hello --out screenshot.png. The command writes PPM
directly or converts to PNG with ImageMagick; the referenced JPG was produced
from that PNG with ImageMagick.
See the docs/ directory:
- Building - How to build CrabEFI and run tests
- Architecture - Workspace layout and code organization
- Integration - Using CrabEFI as a library in external firmware
- Memory Management - Memory layout, allocators, and EFI memory map
# Enter nix development environment (provides QEMU, mtools, etc.)
nix develop
# Build the coreboot payload
./crabefi build
# Run integration tests
./crabefi test --app hello
# Run interactively in QEMU
./crabefi run --app hello
# Build for aarch64
./crabefi build --arch aarch64| Crate | Description |
|---|---|
crabefi-core |
Core library -- platform-agnostic UEFI implementation |
crabefi-coreboot |
Coreboot payload binary (arch entry points, table parsing) |
crabefi-drivers |
Standard hardware drivers (NVMe, AHCI, USB, SDHCI, SPI, serial) |
crabefi-runtime-abi |
Pointer-free normalized image/handoff ABI |
crabefi-runtime-image |
Separate EFI Runtime Services image with image-local bounded scratch allocation |
External firmware implements boot-only platform traits, provides a normalized runtime image plus value-only runtime mechanisms in PlatformConfig, and calls crabefi::init_platform(). See docs/INTEGRATION.md for details.
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
