Tiny bare-metal programs: Mandelbrot in 88 bytes, an OS in 512 bytes

As a warm up:

With all that setting the scene done, let’s get down to how I wrote an 88-byte 8086 bare-metal mandelbrot generator.

See
An 88 Byte Bare-Metal Mandelbrot Generator

And here’s Óscar Toledo G’s BootOS:

bootOS is a monolithic operating system that fits in one boot sector. It’s able to load, execute, and save programs. Also keeps a filesystem. It can work with any floppy disk size starting at 180K.

[Side note; the Familia Toledo are performing a ground-up computing crusade. Here’s their $99 computer with homegrown OS and web browser.]

In the HN discussion about BootOS, we see many interesting points and links, and more offerings:
bootBASIC, a 512-byte application for BootOS
SaxOS another, unrelated, OS in 512 bytes

Oh, and it seems there was an annual contest for 512 byte operating systems.

4 Likes

I was very curious to see how he dealt with disk I/O in BootOS. As it turns out, he just calls into the PC’s BIOS (using INT 13h) and lets that do all real work. That turns this from a 512-byte OS into a multi-kilobyte OS. It’s may be reasonable to argue that one should separate the core OS from the device drivers and count the core OS alone, but I think that’s an argument that should be made explicitly, not by quietly using several kilobytes of BIOS code.

That said, his concept of a file system is mildly interesting. Though I wonder, why not allow longer files by using the entire track for a file, rather than just the first sector? Is this just to save a bit of code, or is there another reason?

Also, it appears that if you have unformatted floppies, you need to first format them with another OS before you can use the format command in BootOS. (Or maybe I’m just misreading things; the BIOS does provide routines to format tracks and even the entire diskette.)