Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I would really like to understand how an operating system works behind the scenes. However, I think that the kernel of most open-source OSs out there are too complex for learning purposes, even for a full-time programmer to learn. Are there any "simple" OSs made for learning purposes only out there?

share|improve this question

closed as primarily opinion-based by ChrisF Oct 23 '13 at 8:01

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

    
    
    
I found this on my search, never tried it. pdos.csail.mit.edu/6.828/2012/xv6.html apparently it was written to replace Unix v6 as a learning tool. –  richard Jul 3 at 15:19

10 Answers 10

up vote 26 down vote accepted

Andrew Tanenbaum's Minix (see Operating Systems Design and Implementation) is intended for exactly this sort of purpose. Another (albeit quite dated) possibility is to read through Lion's Book, which covers Unix V6 (full Unix, but an old enough version that it's still simple enough for fairly easy study). The obvious disadvantages of the latter are that the C it uses is quite obsolete, so even fairly experienced C programmers may find parts somewhat difficult to read, and you can't plan on a modern compiler digesting the code.

share|improve this answer
5  
MINIX 3 is not a teaching tool and the MINIX 3 microkernel is definitely not easy to understand. According to Tanenbaum only MINIX 1 was a teaching tool. –  faif Apr 5 '12 at 17:12

Minix is a great choice and is described in one of the other responses.

Xinu

Also consider XINU - XINU Is Not Unix.

Is is also UNIX spelled backward.

There is a book by Douglas Comer that I thought was well written, well illustrated, and well scoped.

There is an Embedded Xinu and a website about teaching with Xinu.

http://xinu.mscs.mu.edu/Teaching_With_Xinu

FreeRTOS

Another smallish OS that gets a lot of love these days is FreeRTOS. It runs on almost everything. If you came from Mars and had a processor or eval board where it doesn't run, you could read about 10 pages of documentation, modify about five files related to interrupts, timers, and UARTs and you would be running.

http://www.freertos.org/

They claim it supports 31 architectures and 18 tool chains. My experience in late 2009 was good, and I hear it has been improved a lot since then.

Other Links

A similar questions on that might have helpful information for you is located here:

http://stackoverflow.com/questions/254149/how-do-you-write-a-basic-operating-system

Linux and a lot of other operating system design is influenced by UNIX, so this video where the original designers (Kernigan, Richie, and Thompson and others) is both informative and gets the design ideas right from the source.

http://techchannel.att.com/play-video.cfm/2012/2/22/AT&T-Archives-The-UNIX-System

There is a classic but often revised operating systems text book:

Silberschatz, Galvin, Gagne: Operating System Concepts, 7th Edition

There may be newer editions too. I seldom link to a book through a book seller, but the preview is very generous, so to learn more about operating systems, please check out:

http://www.amazon.com/Operating-System-Concepts-Abraham-Silberschatz/dp/0470128720

share|improve this answer

People can understand all of CP/M and early DOS versions. After that things got out of control and nobody knows everything anymore. They weren't designed for learning how an OS works but many people did learn that from those OS.

share|improve this answer
    
Consider adding some references or additional anecdotal evidence to back up your answer. Or add some additional detail to indicate why X version is more easily understood than Y version. –  GlenH7 Sep 24 '12 at 1:40

Go read a book about programming in assembler. You don't have to become profictient at it but it will teach you a lot of the inner workings of a computer.

share|improve this answer

A didactic linux clone, still in progress.

"Bluefire is a didactic OS that was created to show every step of creating a bootstrapping OS.
Design Goals: A teaching OS

The primary mission is to teach OS design. Elegance and advance features are routinely used but never at the expense of the primary goal.

See Blue Fire OS.

share|improve this answer
2  
Can you please edit this answer to provide at least some context to why this is a good example OS based on the question? –  maple_shaft Mar 28 '12 at 0:57

In my university we have learnt NachOS. It's a great open source OS for learning. You can also find many universities exercises on NachOS for learning.

Nachos is instructional software for teaching undergraduate, and potentially graduate, level operating systems courses. The Nachos distribution comes with:

  • An overview paper
  • Simple baseline code for a working operating system
  • A simulator for a generic personal computer/workstation sample assignments
  • A C++ primer (Nachos is written in an easy-to-learn subset of C++, and the primer helps teach C programmers our subset)

The assignments illustrate and explore all areas of modern operating systems, including threads and concurrency, multiprogramming, system calls, virtual memory, software-loaded TLB's, file systems, network protocols, remote procedure call, and distributed systems.

share|improve this answer

Depending upon what you are trying to learn,p-system might do.

It's obviously not a modern kernel, but it is an operating system, and it should be small enough to understand.

share|improve this answer

If you're into the .NET family of technologies, you can check out Singularity. It hasn't been updated since 2008, but can be downloaded in source and ISO form from CodePlex here.

share|improve this answer

Take a look at KOS (Kid OD) and SOS (Simple OS). Both are Operating Systems designed to teach the internals of an OS. KOS is the "father" of SOS, and was built based on the experience gained from KOS.

These projects were the basis of many educational articles in Linux Magazine France.

On the KOS website, you can also find a page where you can download the sources of other simples OSs.

share|improve this answer

You should consider a modern Unix-a-like, the Xv6 operating system, used in an OS course at MIT. It appears to have some course material associated with it, as well.

It runs in both Bochs and Qemu x86 emulators. I did that part. It was fun.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.