Below is a preview of the week-by-week plan for the quarter. There may be adjustments and rearrangements as we go.
Last updated: November 28, 2022.
-
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 after lecture 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 9/26): 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 |
|
Lecture 2 (Wed 9/28): 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 introduce the Unix v6 filesystem as a case study to explore in detail. |
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 9/30): Filesystem Design We'll dive deeper into the specifics of the Unix v6 filesystem, including more about inodes and sectors. |
Lecture 3 Slides |
Out: assign1 |
Week 2 | ||
Lecture 4 (Mon 10/3): Filesystem Design, Continued 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 |
|
Lecture 5 (Wed 10/5): 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 |
|
Section 1: Filesystems | ||
Lecture 6 (Fri 10/7): Crash Recovery We'll explore mechanisms for filesystems to recover in the event of a crash, and the design challenges inherent in crash recovery. |
Lecture 6 Slides OSPP, Chapter 14 up through Section 14.1 |
|
Week 3 | ||
Lecture 7 (Mon 10/10): Crash Recovery, Continued We'll continue exploring mechanisms for crash recovery, including journaling. |
Lecture 7 Slides |
In: assign1 Out: assign2 |
Lecture 8 (Wed 10/12): 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 |
|
Section 2: Filesystems/crash recovery | ||
Lecture 9 (Fri 10/14): Multiprocessing System Calls We'll dive deeper into the fork system call and introduce waitpid to wait on a child process plus execvp to run a different program within a process. |
Lecture 9 Slides Lecture 9 Code |
|
Week 4 | ||
Lecture 10 (Mon 10/17): Interprocess Communication with Pipes We'll introduce the pipe system call, which gives us a way for processes to send and receive data. |
Lecture 10 Slides Lecture 10 Code |
In: assign2 |
Lecture 11 (Wed 10/19): 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 |
Out: assign3 |
Section 3: Multiprocessing | ||
Lecture 12 (Fri 10/21): 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 |
|
Week 5 | ||
Lecture 13 (Mon 10/24): 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 |
|
Lecture 14 (Wed 10/26): 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 |
|
Section 4: Multithreading | ||
Lecture 15 (Fri 10/28): Multithreading patterns We'll look at general multithreading patterns and how we can apply locks and condition variables to implement them. |
Lecture 15 Slides Lecture 15 Code |
In: assign3 Out: assign4 |
Week 6 | ||
Mon 10/31 - NO LECTURE (rest day) | (Tues) Midterm Exam 7-9PM | |
Lecture 16 (Wed 11/2): Scheduling and Dispatching We'll explore how the operating system schedules and switches between threads that want to run. |
Lecture 16 Slides OSPP, Chapter 7 up through Section 7.2. |
|
No section this week. | ||
Lecture 17 (Fri 11/4): Scheduling and Dispatching, Continued We'll continue exploring how context switching between threads works within the operating system. |
Lecture 17 Slides Lecture 17 Code |
|
Week 7 | ||
Lecture 18 (Mon 11/7): Scheduling and Preemption We'll explore tradeoffs in deciding which thread gets to run next and for how long, and see how we can implement the round robin scheduling pattern. |
Lecture 18 Slides | In (Tues): assign4 |
Lecture 19 (Wed 11/9): Preemption and Implementing Locks We'll turn our attention to how the operating system implements locks for programs to use. We'll explore the challenges of implementing locks on single core systems. |
Lecture 19 Slides Lecture 19 Code OSPP, Section 5.7 |
Out (Thurs): assign5 |
Section 5: Dispatching and Preemption | ||
Lecture 20 (Fri. 10/11): Implementing Locks and Condition Variables We'll continue discussing how locks are implemented and briefly discuss condition variables. |
Lecture 20 Slides |
|
Week 8 | ||
Lecture 21 (Mon 11/14): 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 |
|
Lecture 22 (Wed 11/14): Dynamic Address Translation We'll explore dynamic address translation, where the OS intercepts memory references and translates them dynamically. |
Lecture 22 Slides |
|
Section 6: Virtual Memory | ||
Fri 11/18 - NO LECTURE (rest day) | ||
Holiday: Thanksgiving (11/21 - 11/25) | ||
Week 9 | ||
Lecture 23 (Mon 11/28): Paging We'll explore one particular dynamic address translation approach called paging in detail. Paging consists of chopping virtual and physical memory up into fixed size pages and mapping virtual pages to physical ones. |
Lecture 23 Slides |
|
Lecture 24 (Wed 11/30): 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 24 Slides OSPP, Chapter 9 |
In: assign5 Out: assign6 |
Section 7: Demand Paging | ||
Lecture 25 (Fri 12/2): 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 25 Slides |
|
Week 10 | ||
Lecture 26 (Mon 12/5): 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 12/7): 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 12/9 - NO LECTURE (rest day) | In: assign6 | |
Final Exam Week | ||
Final Exam: Fri December 16, 8:30AM-11:30AM |