Skip to content

os8088 v1.0.20260801.1

Choose a tag to compare

@jggonz jggonz released this 02 Aug 05:30
· 23 commits to main since this release
1518792

One binary, three display adapters. The kernel probes the video card at boot and drives whichever it finds -- VGA at 640x480 in 16 colors, a Hercules card at 720x348, or a CGA at 640x200 -- so os8088 now runs on the monochrome hardware an actual 1983 PC was likely to have, and it cost 1,171 bytes to do it.

The video card is decided at boot, not at build time (#34)

os8088 has always required a VGA. It no longer does. kernel/viddet.inc probes in the order VGA, then Hercules, then CGA, and sets the mode itself: mode 12h through the BIOS for a VGA, mode 6 for a CGA, and the 6845 registers directly for a Hercules, because no BIOS will do it for you. The equipment word is consulted last -- an EGA or a VGA driving a monochrome monitor also reports a mono card, and those machines belong on the mode 12h path. One documented scope cut: a Hercules is not distinguished from a plain MDA. An MDA is text-only so there is no better action available, and driving it as a Hercules is strictly less wrong than driving it as a CGA at the wrong address.

There is no second graphics driver (#34)

A monochrome card is a different enough machine that the obvious answer is a second driver, and the obvious answer was wrong. vgabb.inc, the software renderer written for the optional back buffer, was already latch-free and port-free -- it drew into RAM, and nothing in it cared that the target was RAM. Point it at the framebuffer, tell it there is one bit plane instead of four, route its row advances through a banked next-row helper, and it is the 1bpp driver. Hercules and CGA then differ from each other in four numbers in a table. That is what made this affordable: 1,171 bytes of code, against roughly 3KB for a driver written twice. The planar routines are simply unreachable on a mono machine and keep their assembly-time constants.

The screen size is a variable now (#34)

Chrome that had been pinned to 640x480 since the first window appeared -- the dock strip, the clock cell at the right end of the menu bar, the pull-down item cap, the column the drive icons stand in -- is derived from the live geometry at boot, and reproduces its old constants exactly at 640 wide. Windows are clamped onto the real screen when created, so all five shipped packages place correctly on a 200-line CGA with no rebuild: the same .o88 files from the same disk. A package that wants to know what it actually got can ask, through a new call in the kernel's table.

Two flags where there was one (#34)

The back-buffer flag used to mean two things at once: route drawing through the software renderer and a buffer is armed and must be flushed. On a mono machine the first is permanently true and the second is permanently false, so they had to come apart. Without the split, a 256KB Hercules machine would have reported double buffering in the Control Panel and billed 150KB of RAM it never allocated. The nine places that dispatch on it needed no new code.

Also fixed: the Task Manager painted over the dock (#34)

Nothing in this kernel clips a draw to a window -- the clip is to the screen -- and the Task Manager laid its rows out from fixed constants with no check against its own height. On a 200-line screen it repainted straight over the dock once a second. Its two row lists now stop at a computed limit. Separately, the mouse test driver was silently dropping moves on a fast host, because the emulated serial mouse runs at 1200 baud and loses a packet whose predecessor is still in flight; it paces itself now. The symptom was a cursor that never moved while every screenshot still looked plausible.

Notes

  • Nothing changes on a VGA machine: the mode 12h output of this build was compared byte for byte against the previous one, with double buffering armed and windows re-dragged, on both floppy geometries. It is pixel-identical, which is why the screenshots on the site were not recaptured.
  • On a monochrome adapter the sixteen colors reduce to black, white and a 50 percent dither, and double buffering is unavailable by design -- the renderer already writes the framebuffer directly, so there is nothing to double. The Control Panel's Display page says so rather than offering it.
  • The boot splash draws only its progress bar on a mono adapter. Its dialog does not fit in 200 rows, and it runs before any other module is in memory, so the bar is deliberately kept on all three cards: a wrong stride, wrong bank arithmetic or wrong height each fail it visibly, and differently, on hardware with no debugger.

The build

Kernel image 40,636 bytes
Image + .bss 38,657 of 45,056 (6,399 free)
Source 34,465 lines across 28 kernel modules

Since v1.0.20260801:

1518792 Three video adapters, one binary: VGA, Hercules and CGA (SPEC.md 39) (#34)

The four images are attached. apps.img and apps360.img are byte-identical to the previous release -- no package changed. Checksums and the browser demo are on the download page: https://os8088.com/download/