A Stripped-Down Limine Fork for LunaOS
π Minimal β’ π‘οΈ Proven β’ β‘ Fast β’ π LunaOS-Native
Features β’ What We Changed β’ What We Kept β’ Philosophy
Null is a minimal bootloader for LunaOS - a stripped-down fork of Limine with ~4,300 lines of dead code removed. It does exactly one thing: boot LunaOS kernels via the Limine protocol.
The numbers:
- ποΈ ~4,300 lines removed - Multiboot, Linux boot, Chainload, ISO9660
- π¦ 19 files deleted - unused protocol handlers and filesystems
- β 1 protocol supported - Limine (the only one LunaOS uses)
- π 0 regressions - boot process untouched
π‘ Philosophy: Use proven code. Remove unused code. Touch nothing else.
|
π₯οΈ Boot LunaOS
|
π Network & Storage
|
|
β Removed Protocols
|
β Removed Filesystems
|
π‘ Why?
|
| Component | Lines Removed | Status |
|---|---|---|
π multiboot1.c/h |
~560 | ποΈ Deleted |
π multiboot2.c/h |
~1,360 | ποΈ Deleted |
π linux_x86.c |
~630 | ποΈ Deleted |
π linux_risc.c |
~450 | ποΈ Deleted |
π chainload.c/h |
~370 | ποΈ Deleted |
π iso9660.s2.c/h |
~580 | ποΈ Deleted |
| π© Assembly files | ~220 | ποΈ Deleted |
π menu.c dispatch |
~30 | βοΈ Simplified |
| π Total | ~4,300 | β Gone |
| Component | Purpose | Status |
|---|---|---|
| π§ Limine protocol | Boot LunaOS kernels | β Essential |
| π Boot menu | Recovery mode, kernel selection | β Essential |
| π FAT32 | Read kernel from EFI partition | β Essential |
| π PXE/TFTP | Network boot (sister resurrection) | π‘ Useful |
| π Crypto | Ed25519 signatures & X25519 encryption | β Essential |
| πΊοΈ Memory map | DO NOT TOUCH | π Sacred |
| π SMP boot | DO NOT TOUCH | π Sacred |
| π Paging | DO NOT TOUCH | π Sacred |
We tried everything else:
| Attempt | Duration | Result |
|---|---|---|
| π¨ Custom bootloader from scratch | 1 week | π Crying, almost quit |
| π§ "Reorganizing" Limine memory | 1 day | π SMP disappeared |
| π¦ Translating to Rust | 2 days | π₯ Failed miserably |
π― Conclusion: Use proven bootloader, strip bloat, move on.
- π« Never touch memory map - It works. Don't ask how.
- π« Never touch SMP boot - It works. Don't ask why.
- π« Never touch paging - It works. Just be grateful.
- βοΈ Remove unused code - Less code = fewer bugs.
- π Keep the boot menu - Recovery mode saves lives.
Null includes a classical cryptographic stack for secure boot. Post-quantum cryptography (Dilithium/Kyber) has been removed based on MLE (Multiversal Law of Existence) theoretical analysis demonstrating that quantum computing as theorized cannot exist.
| Component | Algorithm | Security Level | Key Sizes |
|---|---|---|---|
| π Signatures | Ed25519 | 128-bit | PK: 32B, SK: 64B, Sig: 64B |
| π Key Exchange | X25519 | 128-bit | PK: 32B, SK: 32B |
| π Symmetric AEAD | ChaCha20-Poly1305 | 256-bit | Key: 32B, Nonce: 12B, Tag: 16B |
| Metric | PQC (Removed) | Classical | Improvement |
|---|---|---|---|
| Boot overhead | ~15-25ms | ~1-2ms | 10-20x faster |
| Signature size | 3,309 bytes | 64 bytes | 52x smaller |
| Public key | 1,952 bytes | 32 bytes | 61x smaller |
| Code size | ~15KB | ~3KB | 5x smaller |
Signing protects against kernel replacement (integrity):
Developer User's Machine
β β
β kernel.elf + secret key β
β β β
β [luna_sign] βββββββββββββββΊ kernel.signed
β β
β BOOTX64.EFI ββββββββββββββΊ Bootloader verifies
β (has public key) signature before
β executing kernel
Encryption protects against kernel reading (confidentiality):
Developer User's Machine
β β
β kernel.signed + encryption key β
β β β
β [luna_crypt] ββββββββββββββΊ kernel.enc
β β
β BOOTX64.EFI ββββββββββββββΊ Bootloader decrypts
β (has decryption key) then verifies
Signed kernel: [kernel data][Ed25519 signature (64 bytes)]
Encrypted kernel (LUNAENC2 format):
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Magic: "LUNAENC2" (8 bytes) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Ephemeral X25519 Public Key (32 bytes) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ChaCha20 Nonce (12 bytes) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Poly1305 Authentication Tag (16 bytes) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Encrypted Data (variable length) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Header overhead: 68 bytes (vs 1604 bytes with PQC)
- Keys are per-developer - Each developer generates their own keypair
- Bootloader + kernel are paired - A bootloader only verifies kernels signed with its embedded public key
- Back up your secret keys - Store
keys/*.secfiles securely; if lost, you cannot sign new kernels - Never commit secret keys -
.secfiles are gitignored by default - Pre-built binaries are useless - A downloaded bootloader has someone else's keys embedded
./setup-crypto.sh # Full setup (recommended)
./setup-crypto.sh --tools-only # Only build tools
./setup-crypto.sh --keys-only # Only generate keys
./setup-crypto.sh --build-only # Only rebuild bootloader
./setup-crypto.sh --clean # Clean and start fresh
./setup-crypto.sh --no-encryption # Signing only (no encryption)
./setup-crypto.sh --help # Show all options./setup-crypto.sh./bootstrap
./configure --enable-uefi-x86-64
makeSee INSTALL.md for full build instructions.
Null follows the LunaOS unified versioning scheme:
- Version:
2025.12.100(YYYY.MM.BBB) - Increment: Bump BBB (100 β 101 β 102) per release
- Reset: Back to 100 each month
See VERSIONING.md for details.
Licensed under the BSD 2-Clause License
Based on Limine by mintsuki and contributors.
See COPYING for full details.
Null is a minimal fork of the legendary Limine bootloader. We're deeply grateful to mintsuki and the Limine community for creating such a robust foundation.
What we took:
- π§ Proven boot process (memory, SMP, paging)
- π¦ Limine protocol implementation
- π Boot menu system
- π FAT32 and PXE support
What we gave back:
- π A lesson in humility (don't rewrite bootloaders)
Null is a core component of LunaOS - the first operating system built on the Coherence Paradigm.
Null embodies the First Law of Computational Physics (LCP):
- π― Minimum viable code - Only what's needed to boot LunaOS
- π‘οΈ Proven foundations - Use Limine's battle-tested boot process
- π Zero entropy increase - Remove code, don't add it
"The best bootloader is the one that gets out of the way."
./configure --enable-uefi-x86-64 && makeπ Build Instructions β’ βοΈ Configuration β’ π Issues
Made with π by the LunaOS team
dΞ΅/dt β€ 0