Now with 100% more asteroids!
This repository contains a toy project for implementing an UEFI application in Rust mainly by using the uefi crate. It experiments with using the UEFI boot services, specifically the Graphics Output Protocol (GOP) and Input devices, and provides utility scripts for bundling the binary into an EFI System Partition (ESP) or a flashable image. The example can be run directly in QEMU from either source.
Build a local ESP directory and boot from it using QEMU:
just build && just run-qemuAlternatively, build an image and boot from it:
just build-img && just run-qemu-imgWhen run with just run-qemu:
- Arrow keys for movement
- Space key for firing
- Brackets (
[,]) for changing projectile speed - ESC to exit to UEFI
To quit from QEMU interactive mode, press Ctrl-Shift-Q
(or Ctrl-Shift-A to detach from input capture).
rustup target add x86_64-unknown-uefi
sudo apt install qemu-system ovmf libguestfs-toolsRunning off a directory mount:
just build: Build the application indebugflavorjust run-qemu: Run the application in QEMU
With image files:
just build-img: Build the application inreleaseflavor and create a UEFI imagejust run-qemu-img: Run the application in QEMU from the UEFI image
Additional commands used internally but provided for convenience:
just package: Package the application into anesppartition and prepare UEFI variables; called internally.