DEPARTMENT OF COMPUTING

CS 3400: Operating Systems

“xv6” refers to the xv6 commentary book, our guide to the xv6 operating system source code.

“3ep” refers to Operating Systems: Three Easy Pieces, our (free) primary text.


Resourses

Kernels

  1. Hello, world
  2. Coroutines
  3. Threads
  4. Spinlocks
  5. Interrupts

Projects

  1. Tracing the threads kernel with GDB

Linux users

To install the tools you need for this class using Debian:

sudo apt install git build-essential gcc-riscv64-linux-gnu gdb-multiarch qemu-system-misc

Note: make sure you have an up-to-date Linux distribution. Notably Ubuntu 22.04 is too old.

MacOS users

Homebrew is a command line tool for MacOS for installing open source software. If you do not already have it, install it here:

Be careful to note the instructions it sometimes gives at the end of the install process. You may need to complete a manual step and/or log out/log in before it is completely ready.

Next install the tools:

xcode-select --install
brew install riscv64-elf-gcc qemu riscv64-elf-gdb

You must also edit the xv6 Makefile if you will be using the debugger. Find the line:

QEMU = qemu-system-riscv64

and add this line right after it:

GDB = $(TOOLPREFIX)gdb

then in the qemu-gdb target, find:

@echo "*** Now run 'gdb' in another window." 1>&2

and replace it with:

@echo "*** In another terminal, run: $(GDB) -x .gdbinit" 1>&2

Installing xv6

To start with a fresh instance of xv6:

git clone https://github.com/mit-pdos/xv6-riscv.git

In the main directory you should be able to run make qemu to build and launch the system. Typing ctrl-a x will quit.

Last Updated 09/08/2026