Loading…
← BACK TO ARCHIVE

We rebuilt an entire kernel to change three lines

The stock FreeDOS KERNEL.SYS prints its banner from a packed image whose strings cannot be edited. For a 386 to boot saying CASTALIA DOS — and nothing else — we had to recompile the kernel from source.

The design rule of Castalia DOS is brutal in its simplicity: when the machine powers on, it opens onto CASTALIA and nothing else. No “FreeDOS kernel,” no “Open Watcom,” no license wall scrolling past. It sounded like changing three strings. It ended up being a kernel rebuild.

The problem: strings inside a packed image

The stock KERNEL.SYS prints its sign-on and a license block unconditionally, from a compressed (UPX) image whose strings cannot be edited in place. A hex edit corrupts the checksum; unpacking and repacking by hand is hopelessly fragile. The only honest route was the front door: rebuild the kernel from its own published source, with a single marked change in the sign-on routine, and ship it uncompressed.

FreeDOS explicitly permits this white-label step, and we do it in the open: its copyright and license travel with the source, published beside every floppy image, in the license tree, and on the system’s own About screen. Honesty was non-negotiable: the banner says CASTALIA DOS, and the About says “Built on FreeDOS (GPLv2+).” Both are true.

It is a three-line change you can only make by recompiling the whole kernel.

And on every commit, a disk boots

What keeps me up at night is not compiling a 1994 kernel with NASM and Open Watcom in 2026 — that, surprisingly, works first try if you respect the makefile. It is not breaking it afterwards. So CI assembles a bootable 1.44 MB floppy on every commit and actually boots it in a headless emulator, asserting it reaches AUTOEXEC.BAT from cold. A DOS that does not boot is not a DOS.

The INSTALLED screen: the keep stands. Old config backed up, rescue floppy in hand.
The INSTALLED screen: the keep stands. Old config backed up, rescue floppy in hand.

D. ABELLÁN · FOUNDER · PRINCETON, IL · 2026.07.05

About Castalia DOS →

// NEXT STEP

Read it, now run it

// ARCHIVE

RELATED FILES

LINKED FILES
TRANSMISSION · BY EMAIL// SUBSCRIBE

Get on the mailing list.

Devlogs, patches and launches, straight to your inbox. Zero spam, zero analytics, no automated list: to unsubscribe, just hit reply.

9DEVLOGS PUBLISHEDSINCE 2026
2LANGUAGESES · EN
0SPAM · TRACKINGEVER

NO TRACKING100%
PRIVACY100%
FREQUENCY2-3/MONTH
// NO AUTOMATED LIST// 0 ANALYTICS// REPLY TO LEAVE// HOSTED IN VIRGINIA