CrabEFI
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 but its core is a platform-agnostic library that any firmware can link against.
Documentation
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
Quick Start
# 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
Workspace Structure
| Crate | Description |
|-------|-------------|
| crabefi (root) | 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) |
External firmware implements a set of platform traits (BlockDevice, VariableBackend, Timer, etc.), builds a PlatformConfig, and calls crabefi::init_platform(). See docs/INTEGRATION.md for details.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.