PIOS: Parallel Instructional Operating System


The time of uniprocessor machines working alone or in loosely coupled configurations is over. The time of massively parallel multicore machines working in tightly coupled data center clusters is here. It is time for undergraduate operating system courses to catch up to this reality, and expose students to the multicore and cluster OS concepts and programming practices they will need in today's and tomorrow's industry and research positions. This is the goal of PIOS—Parallel Instructional Operating System.

PIOS is based on JOS from MIT, but its core kernel, user-space runtime, and programming assignments were redesigned and rewritten by Bryan Ford at Yale to emphasize parallel and distributed OS concepts and programming techniques. To the author's knowledge, PIOS represents the first instructional OS and curriculum in which students build a working multiprocessor, distributed OS, which runs on real multicore PCs, in a one-semester undergraduate-level course. The author used PIOS to teach Yale's CS422: Operating Systems course in Spring 2010, during which all twelve students (about half undergraduate, half graduate), working in teams of 2–3, successfully reimplemented all of PIOS's core components, then added features of their own design such as lazy cross-node address space migration, VGA graphics, and booting from USB on their own laptops.

Since PIOS has been used only one year so far, it is still in an early, experimental state, and will continue to evolve in subsequent years. But adventurous OS instructors are welcome to give it a try, and feedback and improvements are welcome.

PIOS Design Overview

PIOS consists of a boot loader, a microkernel, a user-space runtime embedded in a minimal C library, and a set of sample applications, all sliced into subsets forming an instructional curriculum as described below. The PIOS microkernel implements only four system calls (one only for debugging), and supervises a hierarchy of single-threaded, “shared-nothing” address spaces, as illustrated in the figure at right. User-level code in these spaces execute in parallel on multiple CPUs or multiple nodes in a cluster, synchronizing and communicating in a simple parent/child rendezvous and virtual memory copy model. The kernel extends its API across distributed clusters, “mostly transparently,” by migrating a user-level space cross-node when it needs to rendezvous with a space on a different node.

Despite the kernel API's minimality, PIOS's user-space runtime builds atop it a number of familiar Unix abstractions such as fork/wait process management, console I/O, a logically shared file system, and shared-memory multithreading. In doing so, the design of PIOS's runtime introduces students not only to conventional operating abstractions such as files, I/O, and user-space shells, but also to some advanced distributed systems techniques such as weakly-consistent state replication and distributed shared memory. PIOS is actually a subset of, and was designed concurrently with, Determinator, a research OS for deterministic execution of parallel applications.

Instructional Curriculum

Like JOS, the instructor's version of PIOS contains scripts to “slice” the reference solution into pieces forming a progressive set of OS skeletons, one for each of five programming labs, in which students fill in key components omitted from the skeleton code. Supplied automatic test scripts can also aid in grading. The instructor can adjust the amount of code supplied to the students in the skeleton versus the amount the students must write themselves—and hence the difficulty of the programming assignments—by inserting or removing ‘#ifdef’s in the PIOS reference code. The labs are currently organized as follows: In CS422 at Yale, students have about two weeks for each lab (three weeks for lab 3), and “Lab 6” is a student-chosen final project.


Students anywhere who wish to work through the PIOS labs independently may obtain the template code for each lab from github at:
Note: there are five branches in this repository, one containing the template code for each lab. If you only look at the default “lab 1” branch, you will only find the template code for lab 1 and will miss the others.

Instructors who would like to use PIOS and associated course materials may obtain the full instructional version of PIOS, including the reference implementation (“solutions”), by E-mail to:

Copyright (c) 2010 Bryan Ford, Department of Computer Science, Yale University