Same repo, 40 years later: from 8088 real-mode assembly to x86-64 UEFI C, still the same window manager and the same eleven apps
There are two boot loaders in this repository, and they do not share a line of code. One is 512 bytes of real-mode assembly that asks the BIOS to read a floppy. The other is a PE32+ executable that a UEFI firmware loads into 64-bit long mode with paging already on. Between them sits roughly forty years of PC hardware, and on both ends of that span the same desktop comes up: the same window manager semantics, the same eleven applications, the same theme palettes, the same on-disk formats.
That is the claim I want to make carefully in this post, because it is easy to overstate. The interesting thing is not that one codebase was compiled for two machines. Nothing here was compiled for both. The interesting thing is what an operating system turns out to be when you subtract the machine, and the repository answers that question in a way I did not plan.
The old end
The first commit that booted anything is 4f7a0739, January 22: "v0.2.0: Implement boot loader with graphical Hello World." Its body describes the whole machine model in one breath: a "512-byte IBM PC compatible boot loader" that "Loads 8KB second stage via BIOS INT 13h," then "Video adapter detection (MDA/CGA/EGA/VGA)," "CGA 320x200 4-color graphics mode," and a "Custom 8x8 bitmap font rendering." Everything in that list is a BIOS service or a memory-mapped video card, addressed through segment registers in 16-bit real mode. The kernel that grew out of it still fits in the 104 floppy sectors reserved for it; the 8086 compatibility pass in June records "kernel still exactly 104 sectors with ~3.9KB end slack."
The x86 reference said "Intel 8088 or later" on its README from early on, and for five months that was not true. The June audit found the code was full of instructions an 8088 does not have. dc7f8641, June 11: "8088/8086 compatibility pass: the OS now assembles under 'cpu 8086'." The body is worth reading for what a false claim looks like from the inside:
The audit found 1,153 non-8086 instruction sites across 21 files; on a real 8088 PUSHA/POPA execute as JO/JNO (silent control-flow corruption) and the first INT 0x80 died at movzx/bt. This pass makes the advertised 'Intel 8088 or later' claim true for the floppy-boot system
The fix was mechanical where it could be (a rewriting script over "the kernel, all 16 apps, and boot/stage2.asm," 900-plus sites) and manual where it could not, and then the thing that makes this project what it is: "'cpu 8086' directives in every converted file turn future regressions into assembly errors." The claim became a build failure instead of a sentence. Four days later, cd82b6f8, the floppy image booted on MartyPC, a cycle-accurate 8088 with an open BIOS, and 9adad4da the same night recorded "feature parity on a cycle-accurate IBM PC/XT": nine apps launching on an emulated 4.77 MHz machine with a Microsoft serial mouse on COM1, because a real XT has no PS/2 port.
Two honesty notes, because the ledger makes them. Its row for the x86 reference reads "tested across 8088→486, incl. PS/2 L40 and an Eee PC." But the 8088 fidelity build has its own row directly beneath, and that row says "Never run on a real XT." The physical machines are a 386SX and up; the 8088 is the emulator. And the XT run corrected a README figure on the way through: "The README/FEATURES '128KB minimum' was false; corrected to 256K/640K." The launcher loads at segment 0x2000, which a 128 KB machine does not have.
The new end
886649c9, July 15: "pc64: modern-PC (x86-64/UEFI) world + networking + uno3d." One commit, 81 files, 8,313 lines added. Its opening paragraph states the design in the project's own terms:
Adds the pc64 port: the portable C core (unodos.c/mac_compat/fb + the family apps) booting bare-metal as a UEFI application (PE32+ via mingw-w64, no EDK2/gnu-efi). Firmware-as-BIOS: GOP framebuffer, SimpleTextInput(Ex) keyboard, Simple/Absolute Pointer mouse, boot services alive - the same firmware-hosted pattern as the Pi (VideoCore) and PowerPC Mac (Open Firmware) ports. First 64-bit x86 world.
"Firmware-as-BIOS" is the phrase that ties the two ends together, and the pc64 README says it outright: "UEFI plays exactly the role INT 10h/13h/15h play for the x86 reference kernel." The 1981 machine hands you a framebuffer through a video BIOS call; the 2020 machine hands you one through the Graphics Output Protocol. Same role, no shared instruction.
The same commit records that it was "Validated on real hardware (Lenovo ThinkPad X1 Carbon Gen 8)" and lists "Three metal-only firmware traps found on the X1": eDP panels that "black out on a 640x480 SetMode," a debug port that "can be SMM-trapped and hang the machine," and "phantom-keystroke firmware." The one networking bug it calls out is a C bug, not a hardware one: "mingw is LLP64, so unsigned long DMA addresses truncated the 64-bit descriptor field to 32 bits and the NIC misread the ring." A real-mode assembler has no unsigned long to be wrong about.
In the next three days the modern end stopped being a C translation of the old one. 5eac71ef, July 16: "pc64: unoui shell - the cross-platform toolkit as the whole UI," where "unoui owns windows/focus/drag/menus/widgets/rendering." By 796f5d18 the same morning it was "now the default boot." A day later d9cbe340 gave it something the real-mode kernel never had: "unoui: resizable windows with a corner grip + fill-widget reflow."
And on July 19, c8b4b28f, the firmware left: "pc64: M3 firmware detach - UnoDOS runs on its own drivers." The description is the whole modern kernel in one sentence: "ExitBootServices at the end of boot when the native stack covers the machine: native AHCI moves sectors, a bounded polled i8042 driver (pc64_native.c) supplies PS/2 keyboard+mouse, calibrated-TSC delays pace frames, the CMOS RTC tells time, CF9 resets." The 8088 kernel never needs to do any of this because the BIOS never leaves. The x86-64 kernel has to do all of it because, once it is detached, nothing else is home. At v3.34.0, that kernel is 4,035,034 bytes, about four megabytes, against a reference kernel that fits in 104 sectors of a floppy.
What stayed the same
Three things, and the comparison document names them as the working definition of a port: "The UX: GUI-first, boots to the same windowed desktop with the same default palette," "The app set," and "The on-disk data formats."
The app set is the easiest to check. The ledger defines the reference set as eleven apps: SysInfo, Clock, Notepad, Files, Settings, Dostris, Tracker, OutLast, Pac-Man, Paint, and Browser or Theme depending on the port's profile. Every one of those has a source file under pc64/apps/ at v3.34.0: sysinfo.c, clock.c, notepad.c, files.c, settings.c, dostris.c, tracker.c, outlast.c, pacman.c, paint.c, theme.c. The 8088 runs them as .BIN files loaded through INT 0x80; pc64 runs them as .UNO modules behind a function-pointer table. The comparison document calls these Model A and Model B and then says the quiet part: "It is one architecture ('app-free kernel/core + apps behind a stable interface') expressed through whatever each machine makes natural." The modern end has since grown to 23 applications exercised on metal, but the eleven are the ones every machine in the tree carries, and that is the claim the title makes.
The window manager is where I have to be most careful with the word "same." The real-mode kernel's window manager landed in February (f122a22f, Build 160: close button, outline drag, z-order) and its rules were later extracted into docs/PORT-SPEC.md as a contract: a fixed table of sixteen 32-byte entries, "Z-order is 0-15, topmost = 15," "Click-to-raise," "Title-bar drag: XOR outline during drag, move applied on release." In June, a5f3d0d7 made the x86 kernel source its window arithmetic from the machine-readable version of that contract, "byte-identical, QEMU-verified," and the generator's architecture table at v3.34.0 lists an amd64 layout: "soa c 64 64 le pixels 256 5376B wired/built," a 256-window struct-of-arrays table generated for exactly the machine pc64 runs on.
pc64 does not include it. Nothing under pc64/ or unoui/ references the generated window model or unodef.h at v3.34.0. The project's own adversarial review on July 20 put it bluntly: "The Contract governs the frozen ports and skips the flagship," and "pc64 - the ~45k-line flagship under daily development - consumes the Contract nowhere." What pc64 has is unoui's window manager, "window drag (grab the title bar) with click-to-front z-order" in the toolkit document's words, plus the resize grip the contract never specified. So the honest statement is this: the two ends implement the same window semantics, one in 8086 assembly against a 16-entry table and one in C against a toolkit, and the thing meant to make that sameness mechanical rather than observed, the generated contract, reaches the old end and not the new one. That is a gap in the repository, not in this essay.
What had to be entirely different
Everything that touches the machine, and the list is instructive because it is not the list a textbook would give you.
Boot: the floppy chain is "Boot Sector → Stage2 → Kernel" with CHS reads through INT 13h; the UEFI chain is a PE32+ file the firmware loads and calls. When the agent later added a legacy-BIOS path for pc64 (67e45061 and 0d419196, July 31), it reused the 8086-clean MBR and VBR for the disk half and wrote a new stage2 for the mode switch, and the plan said the old loaders "are cpu 8086-clean, a constraint this chain does not share and should not inherit." The two traps that commit found are pure modern-machine facts: a kernel "linked with file alignment EQUAL to section alignment" because the loader copies bytes rather than parsing a PE, and "Long mode needs SSE turned on by hand," because "the CPU comes out of reset with CR0.EM set and CR4.OSFXSR clear. Firmware does this on the UEFI path, which is precisely why it is easy to forget on this one."
Memory: the XT run found that a 128 KB machine physically does not contain the launcher's segment. The pc64 heap is "a static 32 MB .bss array," and the BIOS-boot commit found the inverse trap: "A PE's .bss occupies no file bytes and stage2 copies file bytes, so on entry every zero-initialised static held whatever the last user of that RAM left behind." Same category of bug, forty years apart, and neither one is findable from the other.
Time: the reference kernel ticks at 18.2 Hz off the PIT. pc64, once detached, has no firmware stall, and "CPUID's TSC-frequency leaf does not exist before Skylake," so it calibrates the TSC against "PIT channel 2 ... the method that has worked since the 8253." The modern kernel times itself with the 1981 chip.
Input: the XT's mouse is a serial port at 1200 baud; the X1 Carbon's trackpad is an I2C-HID device, and its keyboard after detach is a polled i8042, the AT-era successor to the XT's chip, still present on a 2020 laptop. Video: CGA's four colours at 0xB800 against a linear framebuffer at whatever address GOP reports.
The language difference is real and is the least of it. The 8088 end is assembly because the whole OS has to fit on a floppy; the x86-64 end is C because a TCP/IP stack, TLS, a browser and a 3D rasteriser do not get written in assembly by anyone who wants to finish. In between, the same tree builds for other machines in whichever language each one wants, and the comparison document is explicit that sharing code was never the mechanism: "same behavior and same formats, re-implemented natively per machine."
The lesson
An operating system is the part that survives when you change every line that touches the hardware. The repository makes that measurable. Subtract the boot chain, the memory map, the timer, the input path and the video path, and what remains is a desktop with a z-ordered window manager, eleven applications, eight palettes, and a Tracker song format that is byte-identical on a 4.77 MHz 8088 and a ThinkPad. That remainder is the product. Everything else is a port.
The transferable form: if you cannot say which parts of your system are the product and which are the machine it currently happens to run on, you will find out the expensive way, when the machine changes. UnoDOS found out twice in one summer, once downward (the 8086 pass, 1,153 sites that were secretly 386 code) and once upward (a 4 MB kernel that had to learn to calibrate its own clock), and the thing that held across both was not a line of shared code but a written statement of what the OS is, which the old end has been wired to and the new end has not yet. The next post takes the newest thing on that modern end, the browser, and asks what it cost to write one from scratch, with its own TCP/IP, TLS and JavaScript engine, next to a real one the OS now hosts.
Sources: https://github.com/hmofet/unodos, commits 4f7a0739 (Jan 22), f122a22f (Feb 14), dc7f8641 (Jun 11), cd82b6f8 and 9adad4da (Jun 15), a5f3d0d7 (Jun 16), 886649c9 (Jul 15), 5eac71ef and 796f5d18 (Jul 16), d9cbe340 (Jul 17), c8b4b28f (Jul 19), 67e45061 and 0d419196 (Jul 31); docs/PORT-8088.md, docs/PORT-SPEC.md, docs/PLATFORM-COMPARISON.md, docs/bootloader-architecture.md, docs/BIOS-BOOT-PLAN.md, docs/ARCHITECTURE.md, pc64/README.md, unodef/gen/wm/ARCHITECTURES.txt, docs/reviews/2026-07-20-code-review/FINDINGS-arch.md, PLATFORMS.md as reconciled 2026-08-21.