| about System/161
| project news
download | guides and resources | documentation | for instructors | bugs | mailing lists
OS/161 is a teaching operating system, that is, a simplified system used for teaching undergraduate operating systems classes. It is BSD-like in feel and has more "reality" than most other teaching OSes; while it runs on a simulator it has the structure and design of a larger system.
There are two supported branches of OS/161: the 1.x branch, first launched in 2001, provides a uniprocessor kernel programming environment; and the 2.x branch, which debuted in 2009 and was finally fully released in 2015, moves into the multicore era by adding multiprocessor support and other more modern attributes. Both of these branches are actively maintained.
OS/161 includes both a kernel of conventional ("macrokernel") design and a simple userland, including a variety of test programs. It is written in C and uses (but does not itself include) gcc as its compiler. It includes support for only one architecture, but is structured as a portable system, with processor- and platform-dependent code segregated for maintainability.
The base OS/161 system provides low-level trap and interrupt code, device drivers, in-kernel threads, a baseline scheduler, and an extremely minimal virtual memory system. It also includes a simple skeleton file system and an emulator pass-through file system, with a VFS layer to allow using both at once.
Other things are not included and are to be implemented by the students as programming assignments. The basic sequence of these is:
Solution-set code for these assignments is available to instructors.
Note that there is no network stack in the base OS/161. While we generally do not tackle networking in our OS class (as we have a separate networking class) there is network hardware and adding simple networking support to OS/161 is a viable assignment. Porting a real TCP/IP stack is probably not.
For more information on the assignment structure, see the SIGCSE paper.
System/161 is a machine simulator that provides a simplified but still realistic environment for OS hacking. It is a 32-bit MIPS system supporting up to 32 processors, with up to 31 hardware slots each holding a single simple device (disk, console, network, etc.) It was designed to support OS/161, with a balance of simplicity and realism chosen to make it maximally useful for teaching. However, it also has proven useful as a platform for rapid development of research kernel projects.
System/161 supports fully transparent debugging, via remote gdb into the simulator. It also provides transparent kernel profiling, statistical monitoring, event tracing (down to the level of individual machine instructions) and one can connect multiple running System/161 instances together into a network using a "hub" program.
Multiprocessor support is introduced with System/161 2.x, which will run both multiprocessor OS/161 2.x and uniprocessor OS/161 1.x. The System/161 1.x branch is now discontinued. Everyone should move to 2.x.
The primary things that are not in System/161:
David A. Holland, Ada T. Lim, and Margo I. Seltzer, A New Instructional Operating System. Proceedings of the 2002 ACM SIGCSE Conference on Computer Science Education, March 2002. PDF