Lectures on Operating Systems

Mythili Vutukuru
Department of Computer Science and Engineering, IIT Bombay

This page serves as a reference for teaching/learning operating systems (OS). The material consists of video lectures, annotated slides used in the videos, practice problems with solutions, programming lab assignments, and additional reading material for reference.

The content is broadly divided into the following parts.

  • Parts A,B,C,D (lectures 1-20) cover basic concepts of operating systems that are taught in a regular UG OS course in a CS curriculum. This material is mostly based off the excellent online textbook Operating Systems: Three Easy Pieces (OSTEP), with pointers to the relevant chapters of the textbook provided against each lecture. A brief video lecture introduces the concepts from the textbook, and students are strongly encouraged to read the book chapters (that are freely available online) for a more in-depth understanding of the concepts.
  • Part X (lectures 21-32) contains an in-depth discussion of OS concepts using the xv6 operating system as an example. The xv6 teaching operating system comes with concise source code and a textbook/commentary, and is a great resource to understand fundamental concepts using a simple OS. Here are links to the PDF formatted xv6 source code and the accompanying xv6 book for the latest x86 version of xv6 that is used in the lectures.
  • Part N (lectures 33-35) provides an overview of the networking subsystem in Linux, and some recent advances in the area of improving network I/O performance.
Recommended usage: Students and instructors are free to use this material for academic purposes. There are two broad ways to navigate through the video lectures. One can cover the basic concept video lectures based on OSTEP (lectures 1-20) first, followed by a deeper dive into operating systems using xv6 (lectures 21-32). It is also possible to do the basics and xv6 parts together (studying one concept in OSTEP and following it up with understanding the same concept in xv6) by viewing the lectures in this order: Processes (1, 21, 2, 22, 3, 23, 4, 24-26, 5-6), Memory management (7-11, 27-28), Concurrency (12-16, 29-30), and Filesystems (17-20, 31-32).

Older material: I had some old lecture notes on this page for a few years, which are subsumed by the video lectures below. I no longer maintain these notes, but here is a pointer: lecture notes used in 2016, xv6 notes used during 2019-2020, short notes on various related topics.

Credits: Thanks to the OSTEP textbook authors for allowing me to use material from their book in my slides. Thanks also to the xv6 authors for making the xv6 OS available for teaching. Thanks to my TAs over the years who have helped me come up with the various labs and videos.

Feedback: If you have found the material useful, or have suggestions on how it can be improved, I will be happy to hear from you. Please email me at mythili@cse.iitb.ac.in.

Lecture# Topics Video & Annotated Slides References Programming Exercises Practice Problems
PART A: Processes
1 Introduction to operating systems video / slides OSTEP Ch. 2 Lab: Introduction (code)

Lab: Shell (code)
problems on processes
2 Process abstraction video / slides OSTEP Ch. 4
3 System calls for process management video / slides OSTEP Ch. 5
4 Process execution mechanisms video / slides OSTEP Ch. 6

5 Scheduling policies video / slides OSTEP Ch. 7, OSTEP Ch. 8
6 Inter-process communication video / slides Notes on IPC mechanisms

A sample tutorial on Linux IPC mechanisms.
PART B: Memory
7 Introduction to virtual memory video / slides OSTEP Ch. 13 , OSTEP Ch. 14 Lab: Dynamic memory management (code) problems on memory management
8 Mechanism of address translation video / slides OSTEP Ch. 15
9 Paging video / slides OSTEP Ch. 18, OSTEP Ch. 20
10 Demand paging video / slides OSTEP Ch. 21, OSTEP Ch. 22
11 Memory allocation and free space management algorithms video / slides OSTEP Ch. 17
PART C: Concurrency
12 Introduction to threads and concurrency video / slides OSTEP Ch. 26 Lab: Pthreads synchronization (code)

A detailed introduction to the pthreads API is here: OSTEP Ch. 27. You can also find several tutorials like this online.
problems on concurrency
13 Locks video / slides OSTEP Ch. 28
14 Condition variables video / slides
OSTEP Ch. 30
15 Semaphores video / slides
OSTEP Ch. 31

Little Book of Semaphores has many interesting synchronization problems
16 Concurrency bugs video / slides OSTEP Ch. 32
PART D: I/O and Filesystems
17 Communication with I/O devices video / slides OSTEP Ch. 36 Lab: A simple filesystem (code) problems on I/O and filesystems
18 Files and directories video / slides OSTEP Ch. 39
19 File system implementation video / slides OSTEP Ch. 40, OSTEP Ch. 42
20 Hard disk internals video / slides OSTEP Ch. 37
PART X: The xv6 operating system
21 Introduction to x86 hardware video / slides Appendix A of xv6 book

Chapters 3,4 from Programming from the Ground Up
Original/unmodified xv6 code tarball to be used in all xv6 labs below (or you can use the latest x86 version of the code from the xv6 github repo)

Lab: Process management in xv6, (code)

Lab: Memory management in xv6, (code)

Lab: Synchronization in xv6, (code)
problems on xv6 process management

problems on xv6 memory management

problems on xv6 synchronization

problems on xv6 filesystems
22 Processes in xv6 video / slides xv6 code, Pages 21,22 of xv6 book
23 Process management system calls in xv6 video / slides xv6 code, Pages 7-10 of xv6 book
24 Trap handling in xv6 video / slides xv6 code, Pages 39-44 of xv6 book
25 Scheduling and context switching in xv6 video / slides xv6 code, Pages 61-64 of xv6 book
26 User process creation in xv6 video / slides xv6 code, Pages 23-26 of xv6 book
27 Virtual memory and paging in xv6 video / slides xv6 code, Pages 29-33 of xv6 book
28 Memory management for user processes in xv6 video / slides xv6 code, Pages 34-36 of xv6 book
29 Locking in xv6 video / slides xv6 code, Pages 51-60 of xv6 book
30 Sleep/wakeup functionality in xv6 video / slides xv6 code, Pages 65-73 of xv6 book
31 Device driver and block I/O in xv6 video / slides xv6 code, Pages 46-48,75-81 of xv6 book
32 Filesystem in xv6 video / slides xv6 code, Pages 81-90 of xv6 book
PART N: Networking subsystem
33 Network I/O using sockets video / slides OSTEP Ch. 33 Lab: Key-value server

Sample client and server socket programs
problems on networking
34 Network I/O subsystem in Linux Video on Linux kernel network stack and kernel bypass techniques by former PhD students Rinku Shah and Priyanka Naik slides with embedded links to references
35 Kernel bypass mechanisms: DPDK Video on DPDK by former MTech students Diptyaroop Maji and Nilesh Unhale slides with embedded links to references