Skip to content

os8088 v1.0.20260801

Choose a tag to compare

@jggonz jggonz released this 01 Aug 19:00
· 24 commits to main since this release
739889a

The disk becomes real. The software floppy is now a standard FAT12 volume that os8088 reads and writes, folders and a Standard File dialog give files names and places, and the menu bar stops belonging to nobody -- it belongs to whichever application is active, with the kernel itself appearing as one, called Locator.

The software floppy is a standard DOS floppy (#30)

The disk used to be os88fs, a private read-only format shaped around exactly what the kernel had to do. It is now canonical FAT12 -- the thing IBM PC DOS wrote in 1983 -- so DOS, Windows, macOS and Linux all mount it, and you can drop a .o88 onto the floppy with the file manager of whatever computer you happen to be sitting at. The type is decided by cluster count per the Microsoft specification, so FAT16 comes along for free; only the entry decode differs.

Because a foreign machine can now write this disk, every byte on it is treated as hostile: the BIOS parameter block goes through seventeen rules before a single derived number is trusted, and the directory is re-shaped on the way in, with volume labels, long-filename fragments, hidden, system and deleted entries all filtered out. Files load through a size-driven cluster-chain walk with run coalescing, so a file a host wrote back fragmented loads fine and a corrupt chain fails bounded as "Bad package" rather than wandering.

...and os8088 writes it too (#31)

Reading a real filesystem is half of it. kernel/diskw.inc is the other half: create-or-replace, read, delete, rename and free space, reached by the system directly and by packages through the API table. Three rules carry the weight.

  • Commit order -- allocate and write the data, flush the allocation table, then write the one directory sector that commits the file, then free whatever chain was replaced -- so the worst-case power failure leaks lost clusters, which any host fsck reclaims, and can never cross-link two files or lose bytes you already had.
  • Rollback: anything failing before that commit re-reads the allocation table off the disk, so a half-built chain cannot survive in memory to be flushed later by an unrelated write.
  • Coherence by remount: a successful metadata change re-runs the mount, so the directory listing stays exactly a mount snapshot and no new staleness rule enters the kernel.

Writing is gated on a fully successful mount, which is why the boot floppy -- no valid BPB -- can never be written.

Every application owns the menu bar, and the kernel becomes Locator (#32)

The bar was three fixed menus belonging to nobody. It is now three zones: the chip menu, identical in every application and always the first cell; the active application's name; and that application's own menus. Ownership is a window, and it moves through three one-line hooks, so nothing else in the kernel has to know the bar exists -- raising a window activates it, clicking a window that is already frontmost activates it too, and one validation at the top of every bar redraw covers close, minimize and hide at once.

Locator is the kernel acting as an application, the os8088 answer to the Finder: the desktop, the drive icons, the Disk browser and the menus that launch everything else. It is not an instance and has no task -- it is the menu set the bar falls back to, and clicking the bare desktop is how you get back to it.

For a program the whole interface is one API slot and three macros; all five shipped packages take the bar, and every item calls the routine its key or button already called, so the menus are a second door rather than a replacement.

Folders, and four file-manager windows (#33)

A FAT volume has two directory shapes -- the root is a flat run of sectors, a subdirectory is an ordinary cluster chain -- and folders rest on spelling that out exactly once, in a single iterator used by both the mount listing and the write path's slot search, so the two shapes cannot drift apart. Navigation is a remount, the same choice writing already made, so no third staleness rule enters the kernel; going up reads the parent out of the .. link and needs no path stack.

You get up to four Disk windows, each on its own drive and folder, each with its own cached copy of the listing: paints read the cache and actions re-sync first, which is what makes a repaint, a drag or a full-desktop repaint cost zero floppy I/O. New Folder, Rename and Delete are on the File menu -- Delete asks first, because this system has no undo and no trash -- and the right mouse button drops a context menu anywhere.

Files get names: the Standard File dialog (#33)

The file API shipped five whole-file operations and no way to name a file, which is why the Note Pad wrote a hard-coded NOTES.TXT. The Open/Save chooser fixes that, and it is modal on purpose. Because nothing else is clickable while it is up, no other window can navigate the volume, so the dialog reads the global mount snapshot directly and needs no listing cache of its own.

It is not an instance either -- no dock tile, no Task Manager row, closer to a pull-down menu than to an application -- so its close and minimize boxes both reduce to "cancelled" and the module contains no close-path code at all. Window callbacks cannot block, so it shows its window inline and answers later through a completion callback, run after teardown so the program repaints onto clean screen. The Note Pad is its first caller: a document name per instance, Open, Save and Save As.

Resizable windows, a scrolling browser, and fullscreen (#29)

A resizable window draws a Mac-style grow box in its bottom-right corner and resizes through the same rubber-band outline discipline as a title-bar drag. There is no resize callback and there does not need to be: a resizable window lays out from its live record every paint, which is also why the Note Pad re-wraps its text as you drag the corner for free.

The Disk browser stopped baking in its old fixed size -- painter and hit-tester derive every coordinate from one shared layout routine, so they cannot disagree -- and gained a scroll bar, keyboard scrolling, and a list/icon view toggle. Fullscreen is the other half: a fullscreen surface is a real window covering the whole screen with its chrome suppressed, so the existing obscured test silences the background drawers behind it without knowing anything new.

Worth knowing

  • The Disk window lists 8.3 names now -- MINES.O88 rather than MINES -- because that is what is really on a FAT12 disk. A running program still shows the name from its own header.
  • The menu bar changes as you switch applications, and the menus you launch things from belong to Locator. If the bar is showing some other program's menus, click the bare desktop to hand it back to Locator.
  • The software floppy is ordinary FAT12, so you can mount it on any modern machine and copy programs on and off it. tools/os88disk.py still builds one, but it is no longer the only way.
  • The Note Pad saves and loads real files: F2 saves, F3 opens, and Save As names the file through the new dialog. Line endings are translated both ways, so a document written here opens in Windows Notepad and one written there opens here.
  • Only QEMU is exercised routinely. This release is not verified on 86Box or on real XT hardware, though both floppy geometries build and all five size guards pass.

Size

this release v1.0.20260730.1
Kernel image 39,404 bytes 27,582
Image + .bss 37,479 of 45,056 25,079
Binding guard (image + .fartext) 39,404 of 45,056 -- 5,652 free 17,474 free
Source 33,553 lines across 27 kernel modules 23,601 / 25

Headroom is down from 17,474 bytes to 5,652 on the binding guard. The room the memory work bought has largely been spent; moving packages into their own segments is the next tranche.

Downloads

os8088.img and apps.img are the 1.44MB pair for QEMU; os8088-360.img and apps360.img are the 360KB pair for 86Box and period hardware. The software disk holds MINES.O88, HELLO.O88, NOTEPAD.O88, RECORDER.O88 and PIANO.O88.

Also at https://os8088.com/download/