A Rust no_std AArch64 Type-1 (thin) hypervisor + bootloader that is launched by U-Boot (bootelf) and boots a single Linux guest.
This project is WIP and targets QEMU virt and Raspberry Pi 5.
This workspace provides cargo aliases:
cargo xbuild # build (copies artifacts into ./bin)
cargo xrun # run on QEMU (build + run.sh)
cargo xtest # run all tests (std + UEFI/QEMU + U-Boot/QEMU)- Rust nightly (see
rust-toolchain.toml) rust-srccomponent is required (build uses-Z build-std)- Target:
aarch64-unknown-none-softfloat
Typical required tools:
qemu-system-aarch64,dtcsudo,sfdisk,losetup,mkfs.vfat,mount,dd(used byrun.sh)
./u-boot/init.shThis generates:
./bin/u-boot.bin./bin/boot.scr
Add ./create_linux_bin.sh (Docker-based helper) and run:
chmod +x ./create_linux_bin.sh
./create_linux_bin.sh # default Buildroot version
# or
./create_linux_bin.sh 2025.05 # explicit versionOutputs:
./bin/Image(Linux kernel Image)./bin/DISK0(rootfs image, copied from Buildrootrootfs.ext2)
./setup.shThis dumps QEMU’s DTB and writes a modified DTB:
./bin/qemu_mod.dtb
cargo xrunWhat happens:
cargo xrunbuilds theelf-hypervisorpackage and copieself-hypervisor.elfinto./bin/run.shcreates./bin/disk.imgwith:- p1: FAT32 (contains
elf-hypervisor.elf,u-boot.bin,boot.scr,Image,qemu.dtb) - p2: raw rootfs written from
./bin/DISK0
- p1: FAT32 (contains
- QEMU is launched with GICv3 enabled and GDB stub on
tcp::1234
QEMU is started with:
-gdb tcp::1234 # add "-S" in run.sh if you want to stop at resetcargo xrun rpi5This builds rpi_boot.elf and converts it to kernel_2712.img using rust-objcopy.
Copy the resulting kernel_2712.img to your Pi boot media as appropriate.
cargo xtestThe test plan is defined in xtest.txt:
-
stdunit tests for selected crates -
UEFI/QEMU tests for:
- virtio-blk
- FAT32(sudo required)
gdb_remotehandshake
-
U-Boot/QEMU tests for:
- paging stage-1 / stage-2 translation
- gic v2
bootloader(elf-hypervisor): QEMU path entry; sets up EL2 and boots Linux at EL1rpi_boot: Raspberry Pi 5 entryarch_hal: AArch64 HAL (paging, exceptions, PL011, PSCI, timer, GIC)dtb,elf: parsers/helpers used by boot pathsfile+virtio: virtio-blk and FAT32 helper stackgdb_remote+byte_stream:no_stdGDB RSP server over a blocking byte streamallocator,mutex,typestate,intrusive_linked_list: low-level runtime building blocks