A minimal UEFI bootable image that runs a stage-2 loader implemented in OtterLang and started by a tiny UEFI stub.
Note This bootloader is a proof-of-concept . just something i did for fun and out of boredom. You need Otter compiler for this to actually compile
Overview
uefi/efi_stub.c— tiny UEFI entry (efi_main) written in C (GNU-EFI style); it calls an exportedotter_mainfunction implemented in OtterLang.otter/stage2.ot— the stage-2 loader written in OtterLang (this is the actual Otter code and must contain the loader logic).scripts/build.sh— opinionated helper script that attempts to build the pieces and produce a FAT image withBOOTX64.EFIinEFI/BOOT/.scripts/boot-qemu.sh— helper to boot the FAT image in QEMU using OVMF (UEFI firmware).
Important notes / prerequisites
- You need an Otter compiler (
otterc) that can produce object files; if your local toolchain differs, editscripts/build.shandMakefileaccordingly. - GNU-EFI headers/libraries (or equivalent) are required to compile the UEFI stub (
efi_stub.c). On Debian/Ubuntu:sudo apt install gnu-efi. - QEMU with OVMF for UEFI testing (package usually called
ovmforqemu-ovmf). mkfs.vfat,mcopy(mtools), andddorxorrisofor image creation.
How to build (high level)
- Edit
scripts/build.shto match your toolchain if necessary. - Run:
scripts/build.sh(on Windows you can run under WSL or adapt the script). - Boot:
scripts/boot-qemu.sh(adjustOVMFpath if needed).