CPEN 331

Course staff

Location and time

September 6 to November 29

Friday 11am-12:50pm --- SWNG 221

Friday 3-3:50pm --- MCML 166

Learning outcomes

By the end of the course you will:

  • Understand key operating system concepts, such as resource virtualization, protection and concurrency.
  • Be very comfortable navigating around the OS161 source code -- a teaching operating system highly resemblant of BSD.
  • Have implemented crucial parts of the kernel infrastructure, such as synchronization primitives, processes and file tables, system calls and virtual memory.
  • Be very comfortable with kernel development tools, such as common editors (emacs, vim), code-browsing tools (e.g., cscope), a debugger (gdb) and a source control system git.
  • Have enough confidence to hack a real operating system.

Grading formula

The following formula will be used to assign your raw mark for the class. The raw mark usually translates into your final letter grade, though sometimes we curve the marks or adjust the marks based on your contribution to the team projects.

  • 50% Programming assignments. There will be 6 programming assignments.
    • A1 through A5 are each worth 8%.
    • A6 is worth 10%.
  • 10% Class participation -- asking good questions and providing good answers to questions posed by your classmates on Piazza, asking and answering questions in class. See the How to ask questions section below.
  • 20% iClicker and online quizzes
  • 20% oral final exam. You can automatically pass the final oral exam (with the maximum score) if you demonstrate the knowledge of the OS161 source base via interaction with the TAs, the instructor and by providing good answers on Piazza.

A large portion of assignment grades will be allocated to code quality. That's right, in addition to running tests to see if your code does what it's supposed to do, the instructors will read your code to evaluate other aspects of its quality. This means that even if your code passes all the tests, you may not get a 100% mark if your code is poorly documented or if it contains other markers of "bad" coding style. On the positive side, this also means that if your code did not pass the tests, you can still get some marks for code quality if you followed good coding practices. Use this document as a guideline for writing high-quality code.

Rules on completing assignments

  • Assignments 1-3 must be completed on your own.
  • Assignments 4-7 must be completed in teams of two. This document provides guidelines on working in teams.
  • You cannot submit the code written by someone else, except yourself and your partner.
  • Submitting someone else's code constitutes cheating and will not be tolerated.
  • You get a total of 7 late days for assignments 4-7. No late days for Assignments 1-3.


During the course we will read articles from these online textbooks:

  1. The MIT's Xv6 source code booklet and textbook/commentary. Click here and here for the locally cached versions of these texts.
  2. The OSTEP book by Remzi and Andrea Arpaci-Dusseau, plus a bunch of online material.

Policy on cheating

Cheating is not tolerated. You are to write the code for assignments and to answer the code-reading questions by yourself. This means that you must write all the code from scratch, using only what is available in the OS161 code that is given to you. More precisely, you cannot take someone else's code that contains the answer, modify it and submit it as your own. We will use a highly effective system that easily catches code similarity (even if you rename functions and reorder statements), and that is very proficient and catching cheaters. We practice zero-tolerance policy on cheating. If you are caught cheating, you fail the course and your case is reported to the University.

That being said, we will do our best to help you get through the course on your own. We understand that this is a very challenging course and there will be very few people (ever) who will turn up perfect solutions to all assignments by the deadline. Therefore, we will assign grades accordingly. If you work hard, and put lots of concerted and earnest effort into this course you will get a decent grade. Trust us, hard work will pay off. Cheating will not.

How to ask questions

All questions must be asked during labs, office hours or on Piazza. We will not respond to questions posed by email, with very rare exceptions. We will reward those who ask good questions and respond in a helpful way to questions posed by others. Read the following guides on asking questions:

If you abuse the Q&A system by being rude, offensive or by engaging in behaviour that can be described as harassment you may get disciplined in the same way as you would by misbehaving in the classroom. Hiding behind a Piazza alias is not an excuse for being obnoxious. See UBC policy on unacceptable behaviour.

What to bring to class

  • A laptop with your OS161 code
  • Your iClicker
  • A nameplate like this