Skip to content

sermuns/ratatuefi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ratatuefi Zero-bloat Ratatui in UEFI, no OS

qemu-demo.mp4
physical-demo.mp4

Running in QEMU

  1. Install packages:

    pacman -S qemu-system-x86_64 edk2-ovmf

    (optionally, install some graphics backend, but you can also VNC into the VM)

    pacman -S qemu-ui-sdl
  2. Create virtual EFI layout

    just create-virtual-uefi-layout

    then build and symlink the .efi in:
    (<EFI> is something like ./target/x86_64-unknown-uefi/debug/<PACKAGE-NAME>.efi)

    ln -sf <EFI> esp/efi/boot/bootx64.efi
  3. Start QEMU

    just qemu

Running on a physical machine

from https://rust-osdev.github.io/uefi-rs/tutorial/hardware.html

Connect a USB drive. Follow steps below.

# Create the GPT, create a 9MB partition starting at 1MB, and set the
# partition type to EFI System.
sgdisk \
    --clear \
    --new=1:1M:10M \
    --typecode=1:C12A7328-F81F-11D2-BA4B-00A0C93EC93B \
    /path/to/disk

# Format the partition as FAT.
mkfs.fat /path/to/disk_partition

# Mount the partition.
mount --mkdir /path/to/disk_partition /mnt/ratatuefi

# Create the boot directory.
mkdir -p /mnt/ratatuefi/EFI/BOOT

# Copy in the boot executable.
cp $CARGO_TARGET_DIR/x86_64-unknown-uefi/debug/ratatuefi.efi /mnt/ratatuefi/EFI/BOOT/BOOTX64.EFI

# Eject the USB drive
eject /path/to/disk

Important

disable secure boot on machine before trying to boot

try booting it!

Ideas for improving

it is slow as hell to draw. could possibly be improved by

  • adding a buffer, and rendering full lines? currently we are rawdoggin character-for-character.
  • switching to manual VGA graphics (use mousefood?)

was fixed by using -display sdl,gl=on! somehow running without OpenGL makes it really slow!

About

Zero-bloat Ratatui apps in UEFI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors