MOS is the name of a series of kernels/operating systems built primarily as a hobby. The main idea behind is to gain experience in low-level mechanics of computers and their hardware. To allow the greatest amount of flexibility, an exokernel design is followed. The sourcecode is freely available for all to investigate and learn from. Large parts are also available for copying for your own use.


To get a wide horizon, several kernels are written separately, and specifically for a given class of machines. Some kernels have far more progress than others, and some platforms do not have a corresponding operational kernel.

Desktop PC (ia-pc and ia32-pc)

The kind of machine you're almost guarantueed to be using to view this. At the heart of this platform is a processor originally designed by Intel, but with large influences from AMD for the current versions. Since its use is so widespread, there are countless variations possible for any machine. To be able to support all home computers is therefore a large challenge. In fact to get support for all versions ever manufactured would be a lifetime job. Hence the focus is to support all variations of the processor, while giving less attention to the various plug-in hardware that might be there. Due to the scope of the platform, the kernel underwent several rewrites. The first three have been lost in time, and were mainly expansions to a tutorial. The fourth version was a rewrite with the intent to incorporate a working version of seveal key parts. It led to a working kernel and some useful software, but due to the lack of proper considerations, it was practically unextendable beyond its current status. To start from scratch with the knowledge learned from the previous attempt, the fifth kernel would be able to support all the features of the processor that were known at development time. At the time of writing, the kernel is getting along nicely and is pretty much on par with its predecessor. It supports multiprocessing (multiple processors, hyperthreading, or multiple cores), two of the three operating modes, and one of the three MMU modes. It still misses out on the actual creation of multiple threads and the software base. The previous generation kernel can be found under the tag ia32-pc. The current version is labeled ia-pc, with the '32' dropped since it is no longer designed to be run in 32-bit mode exclusively. both 16 and 32 bits mode is available and 64-bit mode has been planned.

Sega Megadrive/Sega Genesis

The first detour from the machine that would host the programming, I decided to pick up some guides into console programming. Of the consoles I knew at the time, the specs were the most interesting to do something with. The Megadrive is a 32-bit console, and for that ahead of Nintendo with its 8-bit system. It runs off a Motorola 68000 as the primary processor, and it has a GPU and a separate slave processor - wich is a Zilog Z80, giving it two different processors on one system. It also features two sound chips to make the player enjoy the music. Things get hairyer when either or both of the extensions are added to the console. The Sega CD was available, adding yet another 68000 core to the system, another GPU unit, and more sound chips, as well as the obvious CD player. The 32X would even add two general purpose processors, both of which are Hitachi SH-2, yet another architecture. Together with a lack of a MMU and concurrency control makes this a difficult target to deal with properly, especially since programs are generally restricted to one kind of processor. As a working start, there is a kernel that prints the legendary words 'hello world' to the screen. Of itself a challenge since it means that the GPU has to be completely initialized to show a decent message on-screen, as well as the protection system that has to be satisfied. The kernel image can be found under m68k-megadrive.

Precision Architecture Servers

One day I got a PA-RISC machine from my dad, which got handed down from the company he worked where it was considered End-Of-Life. The biggest challenge would be to get through the documentation hell around it. The instruction set is reduced such that you aren't even able to do multiplications and divisions in standard assembly. On top of that, there was no working compiler, making life even more difficult. The bootloader that came with linux was badly commented and the fact that everything visible came through a monochrome serial terminal did not make life more attractive. Over time I did manage to get a working compiler (A new version came out, and with some lucky guess patching, something sensible came out), and there is some background code to do those basic operations. As of yet, there is nothing bootable to try however. If you want sourcecode, look at the hppa-hpserver target

Sega Dreamcast

I have something with Sega consoles - probably the average quality of games that got around for those machines. Anyway, Sonic ran on it, Windows ran on it, there was a homebrew scene. So I tried my luck knowing I would dive head-first into the world of only-reverse-engineered documentation. I would not come that far, and got stuck at that protection mechanism. The dreamcast has a weird CD player, called a "GD-Rom" player. It allowed people to stuff one gig of data on something that looked like a CD. It would still read normal CD's but in order to start from one it would need to like a GD. Therefore it needed an IPL matching an image in the dreamcast's ROM (which would require anything to show the license logo before doing anything else) The biggest problem turned out to be the CD formatting. It expects a multisession CD with at least two sections. However, no common CD software would allow for the creation of compatible images, only by burning real CD's. Since that would seriously degrade the development cycle and cost lots of CDs, The work has been postponed until a solution's available A kernel of sorts is available (it should just hang) but it can't be tested for above reasons. The sources are in the sh4-dreamcast target.

Future ideas

There are many, many more kinds of computers around. On several I have done some random programming so I know what can be done. Some machines I might scratch on somewhere:

  • iPod - probably the most common portable computer around, and it is programmable
  • Nintendo Gamecube/Nintendo Wii - I actually have one of these, and there are libraries available for it
  • My own computer. I got some 68000 and AVR hardware lying around that can be interesting