Hello world
Two weeks in. We have a UEFI-loaded kernel that boots, prints, and panics on purpose. Here is what that took, and what we decided early.
We started LeivOS on March 1st, 2024. Two weeks later, the kernel boots from UEFI, runs a smoke test on a serial console, and crashes politely when we ask it to. That sounds modest, and it is. But the small foundations we put in place this week are the ones we will lean on for the next year.
The boot path
UEFI hands us a memory map. The first thing we do — before we touch a single byte of physical memory — is preserve that map exactly as it was given to us. We learned the hard way, in earlier projects, that “I’ll just normalize this” is how you wake up six months later debugging why a specific ThinkPad allocates over the firmware’s own runtime services.
So Uusi keeps the UEFI memory map authoritative. Everything else we do downstream — the page allocator, the kernel page tables, the heap — derives from that table without ever editing it.
A boot smoke test
We added a --smoke boot mode the same week the kernel first ran. It exists for one reason: to keep
us honest. Every commit that touches early boot must still produce a serial line that says we made
it past kernel_main. If it doesn’t, CI catches it before a human does.
The full lifecycle is three lines:
[ok] uefi memory map preserved
[ok] kernel_main entered
[ok] smoke pass: UUSI_SMOKE_PASS
That’s it. It is the whole test. Three lines that must appear in order on the serial console of a QEMU instance, and we treat their absence as a build break. Everything fancier we have built since sits on top of this exact contract.
Panic, on purpose
The other thing we did early was decide what panicking looks like. Most kernels treat a panic as the worst thing that can happen. We treat it as a tool. A panic in Uusi prints:
- the reason
- the file and line that triggered it
- the saved register state
- the last 16 stack frames
…and then it halts. No reboots. No automatic recovery. If something is wrong, we want to see it, not paper over it. Recovery — when it makes sense — happens at higher layers, not in panic.
Why now, and why us
People sometimes ask, reasonably: do we really need another operating system? The answer we keep landing on is that the existing ones are wonderful, and also enormous, and also not going in the direction we want. We don’t think the world needs a thousand operating systems. We do think it can fit one more — small, calm, and built to outlast the people writing it.
We will be writing here regularly as the project unfolds. This is week two. There is a long way to go.