A retrospective account of building a windowed operating system entirely in 32-bit machine code for a homebrew AMD Am29000-based computer in 1996-1997, written by the author at age 18. The OS, named 'Windows Fénix', featured cooperative multitasking, a rectangle-list windowing system inspired by X11's XRegion.c, a manually ported Type 1 font rasterizer, SCSI-abstracted disk I/O, and Unicode file paths — all fitting on a 1.44MB floppy. Decades later, the author wrote an Am29000 emulator from scratch (3075 lines of C, using libSDL2) to revive the original disk images, debugging through millions of instruction cycles to fix emulator bugs including a sign-extension error in EXHWS and backwards PC register handling. The emulator and disk images are available on GitHub with precompiled releases for Windows and macOS.
Table of contents
The world's fastest processorIntermissionThe windows systemThe 1997 disksWhere is everything?What is this?Let's code interrupts!The obsolete floppySunday morningThe human’s memory is blankYour processor is buggyTracking the bug48071124 cycles!libSDL2, nice to see you!Creating a distroDownloadWhat we have hereSome internalsQuestions this post answers
How did early windowed operating systems implement overlapping windows without a GPU?
One approach is a rectangle display list per window. If a window is not overlapped, a single rectangle covers it entirely. When windows overlap, the covered rectangle is cut into up to four sub-rectangles. Drawing then iterates over all sub-rectangles, so a heavily clipped window is drawn more slowly. Apple used a clipping bitmap instead, but that technique was patented. Developers building custom UI renderers or studying windowing internals find deep dives like this on daily.dev.
What is the correct way to implement sign-extension of a 16-bit value to 32 bits in C?
To sign-extend a 16-bit value d to 32 bits, use: if (d >= 0x8000) d -= 0x10000. A common off-by-one mistake is writing d = 0x10000 - d, which produces the absolute value instead of the two's-complement negative, causing silent data corruption that can take days to track down. Catching subtle sign-extension bugs before they corrupt production data is exactly the kind of low-level detail developers share on daily.dev.
How does the AMD Am29000 processor implement multiplication without a hardware multiply instruction?
The Am29000 lacks a native multiply instruction. Instead, a MULTIPLU opcode triggers a trap, and the trap handler executes 32 consecutive MUL instructions that perform bit-shifting to accumulate the result. Returning from the trap requires correctly restoring two PC registers (PC0 and PC1); updating only one causes the trap to re-enter infinitely. Developers working with unusual or legacy ISAs track implementation details like these on daily.dev.