Booting — GRUB images, modules, kernel_main¶
Equinox OS boots via GRUB multiboot as a plain 32-bit kernel — no
UEFI stub, no bootloader of its own. Disks installed with
Qfs -install-boot are made bootable in the same way.
Two boot paths¶
1. Live ISO (make run)¶
src/boot/grub.cfg template → grub-mkrescue → dist/equinox.iso.
One .cfg entry boots kernel.elf with a module line per asset.
2. Installed disk (Qfs -install-boot hdX)¶
The same chain, embedded:
boot.img— the 512-byte boot image (fromgrub-mkimage);core.img— the GRUB core with anearly.cfgprefix, written at LBA 1 of the disk (the region before the FAT32 partition at LBA 2048 stays reserved for it);/boot/grub/grub.cfg— generated by walking the volume and listing.mrp .c .wad .ruf .elf .hfiles;- MBR rewritten with the VBR's BPB.
So a disk produced by the installer is self-contained: GRUB → kernel → modules → shell, with no ISO.
What GRUB hands over¶
- Video mode request: 1360×768×32 via VBE, VGA text fallback.
kernel.elf(multiboot) —kernel_main(mb_magic, mb_info)receives the MEMMAP and the module list.- One module per userland asset, staged at 0x2800000 (12 MB) by
boot/start.asm: - flat
.cfiles → RAMFS/test; - nested trees →
/equinox/tools,/equinox/libc; .mrp/.wad→ placed by theirdist/path;- the
kernel-min.elfmodule is re-registered as/boot/kernel.elfvia a cmdline trick.
kernel_main subsystem order¶
FPU+SSE → idt_init → timer_init(100) → mouse_init
→ vesa (force 1360x768x32) → paging_set_ram_top(mb_info->mem_upper)
→ paging_init → tss_init → init_display
→ fs_init (RAMFS; panic if no root)
→ pci_init → fat32_boot_init (blk_init: ata_init, ahci_init)
→ mrp_bootloader_load_modules(mb_info)
→ syscall_init/sys_init
→ net_init (nic_load_pref via system.ecf → net_nic_init)
→ httpd → shell_entry
Order matters: pci_init and blk_init must precede net_init
because NIC selection reads system.ecf off the mounted volume, and
the E1000 driver needs PCI enumeration.
Early-boot config¶
/equinox/conf/system.ecf is parsed after the first FAT32 mount so
that [net] driver, dependencies.bash and eggkg.* are live before
the shell starts. See SYSTEM_ECF.md.
Serial mirror¶
Boot log and the shell are mirrored to COM1; launch with
-serial file:serial.log to capture them — every QEMU regression
script asserts against that stream.
Hand-rolling the boot disk¶
Qfs -list-disk
Qfs -t hde -format fat32
mount hde
copy dist/equinox /mnt/equinox
set -w /mnt/equinox/conf/system.ecf
Qfs -install-boot hde
Full walkthroughs: INSTALL.md, QFS.md.