Build Your Own OS

The best way to learn about operating systems is to implement one. So programming assignments are the heart of assignments use the excellent OS/161 instructional operating system. OS/161 was developed at Harvard University by David Holland, Margo Seltzer, and others. It provides some of the realism of large operating systems like Linux. But it remains compact enough to give you a chance to implement large OS subsystems—like virtual memory—yourself. This paper provides a good overview of OS/161.

The assignments also provide a variety of different programming challenges. ASST1 is just a warmup. ASST2 challenges you to connect two existing interfaces. ASST3 provides the opportunity to implement a large piece of functionality and design several internal interfaces. These challenges are similar to those that you will face in industry or when building large software systems. And all the assignments require understanding a large and complex code base.

If that wasn’t exciting enough, these assignments are the same ones that kept Mark Zuckerberg busy in his last semester at Harvard—while he was starting Facebook. Many students at multiple institutions have benefited from their struggle with OS/161. We think you will too.

We provide a bit more detail about each assignment below.


This first assignment introduces you to the programming environment you will be working in this semester: the OS/161 operating system, the sys161 simulator, the GNU debugger (GDB), and the Git revision control system.


Your first real taste of kernel programming. Implement critical kernel synchronization primitives—locks, condition variables and reader-writer locks. Next, use them to solve a few simple toy synchronization problems.


The first big and complex assignment. Implement the system call interface. When you are finished, your kernel can run user programs.


The mountain top. A large amount of code to implement and several internal interfaces to design. Implement virtual memory, including address translation, TLB management, page replacement and swapping. When you are done, your kernel can run forever without running out of memory.

Created 2/17/2017
Updated 2/17/2017
Commit fa0ad8a // History // View
Built 2/20/2017 @ 17:42 EDT