Learn CS

6.S081 Operating System Engineering


  • Fall 2020 (latest) website slides ✅ | assignments ✅ | videos ✅
  • Fall 2019 website slides ✅ | assignments ✅ | exams ✅
  • OCW (Fall 2012) Course Home slides ✅ | assignments ✅ | exams ✅


Design and implementation of operating systems, and their use as a foundation for systems programming. Topics include virtual memory; file systems; threads; context switches; kernels; interrupts; system calls; interprocess communication; coordination, and interaction between software and hardware. A multi-processor operating system for RISC-V, xv6, is used to illustrate these topics. Individual laboratory assignments involve extending the xv6 operating system, for example to support sophisticated virtual memory features and network protocols

Prerequisites: 6.004

Schedule (2019)

1Introduction and examples (handouts: xv6 book)Read chapter 1 of the xv6 book (for your amusement: Unix)
2Dynamic memory allocation (allocators)5.1 (Pointers and addresses) through 5.6 (Pointer arrays) and 6.4 (pointers to structures), and 8.7 (Storage Allocator) by Kernighan and Ritchie (K&R)
3C and gdb (pointers example)Read 2.9 (Bitwise operators) by K&R
4Isolation & system call entry/exit Read "Chapter 2: Operating system organization"
5Virtual memory (1)Read "Chapter 3: Page Tables"
6Virtual memory (2) (slides
7System calls, interrupts, exceptionsRead "Traps and device drivers" and the related xv6 source files
8Multiprocessors and locking (slides)Read "Locking" with spinlock.c
9Processes and switchingRead "Scheduling" up to "Sleep and wakeup" and proc.c, swtch.S
10sleep&wakeup;Read remainder of "Scheduling", and corresponding parts of proc.c
11Calling conventions and stack frames RISC-V
12File systemsRead bio.c, fs.c, sysfile.c, file.c and "File system" except for the logging sections
13Crash recoveryRead log.c and the logging sections of "File system"
14File system performance and fast crash recoveryRead Journaling the Linux ext2fs Filesystem (1998)
15Virtual Memory (3) (slides)Read Virtual Memory Primitives for User Programs (1991)
16OS OrganizationRead Exokernel (1995), FAQ
17OS and NetworkingRead Receive Livelock (1996)
18Kernels and HLLRead the Biscuit paper (2018), FAQ
19Scalable locks (slides) (code)Read Non-scalable locks paper (2012), FAQ
20RCU notes, 2018 slidesRead RCU paper (2013), FAQ
21Virtual Machines (1) (slides)Read Software vs Hardware Virtualization (2006) or Disco?


  1. Lab util: Unix utilities
  2. Lab sh: Simple shell
  3. Lab alloc: Memory allocator
  4. Lab lazy: Lazy allocation
  5. Lab cow: Copy-on-write fork
  6. Lab syscall: Uthread & alarm
  7. Lab lock: Parallelism/locking
  8. Lab fs: File system
  9. Lab mmap: Mmap
  10. Lab net: Network stack

What's Next

6.824 Distributed Systems