MikeOS - 16 bit real mode assembly OS

Found an interesting operating system you can't just hold to yourself and want to share with others? This is the place for you.
Post Reply
User avatar
Posts: 5
Joined: Sat Apr 21, 2018 2:54 pm
MikeOS - 16 bit real mode assembly OS

Post by Mcpg » Tue Aug 21, 2018 12:47 pm

This forum is dead, why not post some stuff here? Here we go!


Some time ago I found MikeOS. What IS MikeOS you might ask? Well, it's an OS written in pure assembly, running in real mode (so also @ 16 bit). Author of the OS, Mike Saunders calls it:
Mike Sauners wrote:a learning tool to show how simple 16-bit, real-mode OSes work, with well-commented code and extensive documentation.
I referenced the term "real mode" a few times. What is it?
Real mode is the mode CPU starts with. Why isn't it protected mode, or duh, even long mode in 64 bit? The answer is: backwards compatibility. PCs are backwards compatible, to the point that we can run even the earliest MS-DOS software with CGA graphics on a 64-bit CPU with 32 GB of RAM, just so you can run MS-DOS in 2018 without any bigger problems (until you want to do some drivers, then... well, stuff may be complicated a bit)

The real mode dates back to the beginning of PCs, where it was the only mode CPU could run. Protected mode was added with 80286 CPU, but to maintain compatibility with older software it still started up in real mode.
The largest feature of real mode is that you get access to BIOS services allowing you to, for example, read data from a floppy without writing a proper driver, get input from PS/2 keyboard and mouse, switch video modes, or even execute... BASIC (if your PC actually supports that and has a BASIC ROM). Also, as you're running in 16 bit, you have only 64k of memory to access. This can be bypassed by segmentation, but that's too complicated to explain here. Basically, with use of segmentation you get to access up to the first 1 mebibyte of RAM. You still lose some of that space for BIOS and some other hardware stuff, and in the end you are guaranteed to have 640k of space to use. It's... not that much.

Well.. uh, that was a "quick" introduction to real mode. Let's go back to MikeOS. Is 640k a small amount of space? Well, MikeOS puts everything in one, small, 64k segment - kernel, disk buffer and even software in one, small 64k of RAM - 24k for the kernel, 8k for disk buffer and 32k for external programs. And it also packs its own dialect of BASIC. After booting it up we get this happy message:


After pressing OK this pretty list shows up


Aaaand we also get this command line.


Whenever I take a look at MikeOS I always want to write my own real mode OS, McpgOS. Well, I already planned the memory map and some other OS stuff, maybe I program it someday. :)

Well, if you want to try the stuff for yourself, here's MikeOS website: http://mikeos.sourceforge.net

Mcpg, out.

Post Reply