Skip to content

A very simple efi based bootloader that i made for fun that loads a stage 2 written in otterlang.

Notifications You must be signed in to change notification settings

LqauzDev/OtterBootloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OtterBootloader (UEFI, x86_64)

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 exported otter_main function 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 with BOOTX64.EFI in EFI/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, edit scripts/build.sh and Makefile accordingly.
  • 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 ovmf or qemu-ovmf).
  • mkfs.vfat, mcopy (mtools), and dd or xorriso for image creation.

How to build (high level)

  1. Edit scripts/build.sh to match your toolchain if necessary.
  2. Run: scripts/build.sh (on Windows you can run under WSL or adapt the script).
  3. Boot: scripts/boot-qemu.sh (adjust OVMF path if needed).

About

A very simple efi based bootloader that i made for fun that loads a stage 2 written in otterlang.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published