Below is a preview of the week-by-week plan for the quarter. There may be adjustments and rearrangements as we go.
Last updated: Feb 27, 2023.
-
Lecture videos are posted on Canvas under the "Panopto Course Videos" tab.
-
In the readings listed below, OSPP is Operating Systems: Principles and Practice by Thomas Anderson and Michael Dahlin. These readings are optional.
Lecture Code
Any code examples worked in class will be posted into /afs/ir/class/cs111/lecture-code/lect[N] where you replace [N] with the lecture number. You can make a copy to compile or modify by doing the following, which will make a folder in the current location called lect[N] that is a copy of the lect[N] code.
cp -r /afs/ir/class/cs111/lecture-code/lect[N] lect[N]
You can also view lecture code from your web browser by clicking here.
| Topics | Resources | Assignments |
|---|---|---|
| Week 1 | ||
| Lecture 1 (Mon 1/9): Welcome to CS111! We'll go through course logistics, learning goals, and a tour of the quarter's topics. |
Lecture 1 Slides Handouts: Syllabus, Honor Code |
Out (Tues): assign0 |
| Lecture 2 (Wed 1/11): Intro to Filesystems Topic 1: How can we design filesystems to manage files on disk, and how can we interact with the filesystem in our programs? We'll learn about the responsibilities of a filesystem and the core challenges in designing them. We'll discuss various filesystem designs, including the Unix v6 filesystem, which we'll explore more in depth in subsequent lectures. |
Lecture 2 Slides OSPP, Chapter 11, Section 12.1, 12.2 and Section 13.3 (up through page 567) |
|
| No sections this week. | ||
| Lecture 3 (Fri 1/13): Unix v6 Filesystem We'll dive deeper into the specifics of the Unix v6 filesystem, including more about inodes and supporting large files. |
Lecture 3 Slides |
|
| Week 2 | ||
| Mon 1/16 - No Lecture - MARTIN LUTHER KING, JR., DAY | In (Tues): assign0 Out (Tues): assign1 |
|
| Lecture 4 (Wed 1/18): Unix v6 Filesystem, Part 2 We'll learn about how the Unix v6 filesystem represents directories, the process for file lookup, and explore other possible filesystem designs. |
Lecture 4 Slides OSPP, Sections 13.1-13.2 |
|
| Section 1: Filesystems | ||
| Lecture 5 (Fri 1/20): Filesystem system calls and file descriptors We'll turn to learning about how we can access the filesystem in our programs, and how files are represented as file descriptors. |
Lecture 5 Slides Lecture 5 Code |
|
| Week 3 | ||
| Lecture 6 (Mon 1/23): Filesystem System Calls and Crash Recovery We'll do more practice with file descriptors and explore how filesystems can recover in the event of a crash. |
Lecture 6 Slides Lecture 6 Code OSPP, Chapter 14 up through Section 14.1 |
|
| Lecture 7 (Wed 1/25): Crash Recovery We'll talk about the design challenges inherent in crash recovery and explore mechanisms for crash recovery, including journaling. |
Lecture 7 Slides |
In (Thurs): assign1 Out (Thurs): assign2 |
| Section 2: Crash Recovery | ||
| Lecture 8 (Fri 1/27): Multiprocessing Introduction Topic 2: How can our program create and interact with other programs? How does the operating system manage user programs? We'll learn about what a process is, how the operating system manages them, and we'll practice using the fork system call to create new processes. |
Lecture 8 Slides OSPP, Chapter 4 |
|
| Week 4 | ||
| Lecture 9 (Mon 1/30): Multiprocessing System Calls We'll dive deeper into the fork system call and introduce waitpid to wait on a child process and execvp to run a different program within a process. |
Lecture 9 Slides Lecture 9 Code |
|
| Lecture 10 (Wed 2/1): Interprocess Communication with Pipes We'll introduce the pipe system call, which gives us a way for processes to send and receive data between one another. |
Lecture 10 Slides Lecture 10 Code |
In (Thurs): assign2 Out (Thurs) assign3 |
| Section 3: Multiprocessing | ||
| Lecture 11 (Fri 2/3): Pipes, Continued We'll talk more about pipes, including I/O redirection and how they can enable feeding the output of one process as the input to another. |
Lecture 11 Slides Lecture 11 Code |
|
| Week 5 | ||
| Lecture 12 (Mon 2/6): Multithreading Introduction Topic 3: How can we have concurrency within a single process? How does the operating system support this? We'll learn about what a thread is, how the operating system manages them, and we'll learn about the challenges in writing multithreaded programs. |
Lecture 12 Slides Lecture 12 Code OSPP, Chapter 4 and Chapter 5 up through Section 5.1 |
|
| Lecture 13 (Wed 2/8): Race Conditions and Locks We'll learn about the core challenge of multithreaded programs: race conditions. We'll see how locks ("mutexes") can help address them. |
Lecture 13 Slides Lecture 13 Code OSPP, Sections 5.2-5.4 and Section 6.5 |
|
| Section 4: Multithreading | ||
| Lecture 14 (Fri 2/10): Locks and Condition Variables We'll continue learning about how to use locks to solve race conditions, and introduce another synchronization primitive, condition variables, which allow threads to wait on certain conditions before proceeding. |
Lecture 14 Slides Lecture 14 Code |
|
| Week 6 | ||
| Lecture 15 (Mon 2/13): Multithreading Patterns We'll recap our discussion of condition variables and talk about general approaches to multithreading. |
Lecture 15 Slides |
In: assign3 |
| Lecture 16 (Wed 2/15): Lambdas and the Monitor Pattern We'll learn about the monitor pattern for writing multithreaded code, and lambda functions for writing inline functions, and wrap up our discussion of multithreading. |
Lecture 16 Slides Lecture 16 Code |
(Thurs) Midterm Exam 7-9PM |
| No section this week. | ||
| Lecture 17 (Fri 2/17): Trust, Scheduling and Dispatching First, we'll talk about trusting operating systems and the challenges that come with trust and when it is violated. Then, we'll turn our attention to how the OS keeps track of threads and switches between them. |
Lecture 17 Slides Lecture 17 Code |
(Sat) Out: assign4 |
| Week 7 | ||
| Mon 2/20 - No Lecture - PRESIDENTS' DAY | ||
| Lecture 18 (Wed 2/22): Scheduling and Dispatching, Continued We'll continue exploring context switching, and explore tradeoffs in deciding which thread gets to run next and for how long. |
Lecture 18 Slides | |
| Section 5: Dispatching | ||
| Lecture 19 (Fri 2/24): Scheduling and Preemption We'll talk about more scheduling algorithms and turn our attention to how to implement the round-robin scheduling pattern. |
Lecture 19 Slides Lecture 19 Code OSPP, Section 5.7 |
|
| Week 8 | ||
| Lecture 20 (Mon 2/27): Implementing Locks We'll explore how to implement locks on single-core systems. |
Lecture 20 Slides | In (Tues): assign4 Out (Tues): assign5 |
| Lecture 21 (Wed 3/1): Virtual Memory Introduction Topic 4: How can one set of memory be shared among several processes? How can the operating system manage access to a limited amount of system memory? We'll introduce the concept of virtual memory, where the operating system hides real memory addresses from programs. This explains how multiple programs can all think they can use the same memory address at the same time. |
Lecture 21 Slides Lecture 21 Code OSPP, Chapter 8 |
|
| Section 6: Preemption and Virtual Memory | ||
| Lecture 22 (Fri 3/3): Dynamic Address Translation We'll explore dynamic address translation, where the OS intercepts memory references and translates them dynamically, including paging. |
Lecture 22 Slides |
|
| Week 9 | ||
| Lecture 23 (Mon 3/6): Demand Paging We'll build on our discussion of paging and learn about how we can kick pages to disk when we need more space, effectively making physical memory appear larger than it really is. |
Lecture 23 Slides |
|
| Lecture 24 (Wed 3/8): The Clock Algorithm We'll discuss the clock algorithm for deciding which pages to kick from memory when we run out of space, and wrap up our discussion of virtual memory. |
Lecture 24 Slides OSPP, Chapter 9 |
In (Thurs): assign5 Out (Thurs): assign6 |
| Section 7: Demand Paging | ||
| Lecture 25 (Fri 3/10): Trust + assign6 We'll discuss trust, and use the Meltdown vulnerability as a case study of when assumptions about systems are not upheld. We'll also overview assign6. |
Lecture 25 Slides | |
| Week 10 | ||
| Lecture 26 (Mon 3/13): Extra topics: Virtual Machines and Networking We'll touch on Virtual Machines, which is how we can run multiple OSes on a single machine, and how programs can communicate over a network. |
Lecture 26 Slides Lecture 26 Code |
|
| Lecture 27 (Wed 3/15): Wrap-up and Q&A We'll wrap up the course themes, preview courses and opportunities post-111, and say some final words. Bring questions if you have them! |
Lecture 27 Slides | |
| No sections this week. | ||
| Fri 3/17 - NO LECTURE (rest day) | In: assign6 | |
| Final Exam Week | ||
| Final Exam: Wed March 22, 3:30PM-6:30PM |