Skip to content

x86_64_lilo: legacy non-secure BIOS/MBR boot with a LILO-style installer - #956

Open
danielinux wants to merge 2 commits into
wolfSSL:masterfrom
danielinux:lilo
Open

danielinux wants to merge 2 commits into
wolfSSL:masterfrom
danielinux:lilo

Conversation

@danielinux

Copy link
Copy Markdown
Member
  • Target: x86_64_lilo adds a third x86_64 boot path, alongside UEFI (x86_64_efi) and Intel FSP. It boots from the MBR on legacy BIOS machines with no EFI or FSP stage; the example configuration uses SIGN=NONE.
  • Boot chain: A 446‑byte MBR loader reads wolfBoot from the sectors before the first partition into memory at 0x7E00 using BIOS LBA disk reads. wolfBoot runs in flat 32‑bit protected mode and drops back to real mode for each BIOS disk, keyboard, video and memory‑map call, so it needs no storage driver of its own.
  • Kernel loading: Kernels and initrds are read by file path from a FAT32 partition using wolfBoot's existing FAT32 code. Each kernel is a wolfBoot image, checked with the standard verification before boot. The kernel is started through the Linux real‑mode boot protocol, and other= entries chain‑load a partition boot sector.
  • User interface: It reproduces LILO's behaviour: the L/I/L/O progress letters, a boot: prompt with labels and aliases, Tab to list entries, timeout/delay/Shift key handling, extra parameters typed after the label, and an optional serial console. If an image is missing or fails verification, it returns to the prompt instead of halting.
  • Installer (tools/lilo): It reads /etc/lilo.conf and accepts the usual lilo options (-C -b -i -D -s -t -q -u -v). It writes a CRC‑protected boot map at LBA 1 and wolfBoot at LBA 34, keeping the disk signature and partition table. Before writing anything it checks every image with wolfBoot's own partition and FAT32 code. Because the map holds file paths rather than lists of disk sectors, kernels can be replaced without re‑running the installer.
  • Constraints: It supports MBR partitioning only and refuses GPT disks. other= only reaches primary partitions 1–4. Unsupported lilo.conf options such as password and restricted are rejected rather than ignored. With SIGN=NONE, the image check only detects corruption and authenticates nothing.
  • Validation: tools/lilo/test/run-qemu.py builds a disk image, installs wolfBoot with the installer and boots a stock x86_64 kernel under SeaBIOS. It covers default boot after the timeout, a label with extra parameters typed at the prompt, recovery from an unknown label and a corrupted image, and chain loading. All scenarios pass under both KVM and TCG. The default boot was also checked by hand on IDE, AHCI (q35) and virtio‑blk disks. A CI workflow runs the suite in the wolfboot-ci-x86 container but has not run yet.

Copilot AI balanced review requested due to automatic review settings October 28, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants