CS162: Operating System
Descriptions
- Offered by: UC Berkeley
- Prerequisites: CS61A, CS61B, CS61C; Solid C programming and GDB debugging skills
- Programming Languages: C, x86 Assembly
- Difficulty: 🌟🌟🌟🌟🌟🌟
- Class Hour: 200 hours+
The course impressed me in two aspects:
Firstly, the textbook: Operating Systems: Principles and Practice (2nd Edition) consists of four volumes. It is written in a very accessible yet profound way, with vivid and sometimes even humorous language. It serves as an excellent supplement to the lecture videos and perfectly fills some theoretical gaps left by MIT 6.S081. This is also the experimental textbook for CMU's OS course (15410), I highly recommend reading it! Related resources are shared in the "Classic Books" section of this repository.
Secondly, the project for this course Pintos is a great journey for system hackers. Pintos is a toy operating system developed at Stanford for educational use. The author Ben Pfaff even published a paper to explain the design principles of Pintos.
Unlike the small but comprehensive design philosophy in MIT's xv6 labs, Pintos emphasizes system design and implementation more. The codebase is about 10,000 LOC and only provides the basic functions of a working operating system. Each project has almost no boilerplate code; you must design the implementation yourself and weigh the pros and cons of different schemes. The four projects let you add scheduler (Project1), system calls (Project2), virtual memory (Project3), and the file system (Project4) (Note: The specific requirements for CS162 Pintos differ slightly; see the assignment description below) to this extremely simple operating system. All projects leave a a big design space for students and require more than 2000 LOC. Based on the feedback from Stanford students, the latter two projects take over 40 hours per person even in teams of 3-4 people.
Although it is tough, Stanford, Berkeley, JHU and many other top U.S. colleges have chosen Pintos as their OS course project. If you're really interested in operating systems, it will greatly improve your ability to write and debug low-level system code and teach you how to design a system by making trade-offs between different possibilities. For me, it is an invaluable experience to design, implement, and debug a large system independently.
Pintos will also be introduced as a course project in Peking University's OS Course. In the Spring 2022 semester, I worked with another TA to write a comprehensive lab documentation and provided a docker image for the ease of cross-platform development. In the last semester before graduation, I hope such an attempt can make more people fall in love with systems and contribute to the field of systems in China.
Course Resources
- Course Website:
- Current Semester
- Fa25 - Wayback Machine
- Lecture Videos: Currently, three semesters are publicly available: Fall 2020, Fall 2021, and Spring 2022. Based on my experience with the Fall 2025 semester, the Spring 2022 version is best for self-study. It was recorded in-person (except for the first four lectures), featuring more student-teacher interaction and many valuable questions addressed in class:
- Spring 2022 Lecture Videos (Bilibili)
- Fall 2020 Lecture Videos (Bilibili)
- Fall 2021 video links can be found on the Fall 2021 Website.
- Textbook: Operating Systems: Principles and Practice (2nd Edition). This textbook is an excellent supplement to the lectures and is highly recommended.
- Assignments: Consists of 3 Projects and 6 Homeworks. (The workload for each Homework is roughly equivalent to a full Project in most other open-source courses. Projects were originally designed for teams; self-studying them alone involves a significant workload):
- 3 Projects (each with complete local tests):
- User Programs: Implement argument parsing for process execution, process-related system calls (including the
forksyscall added in 2025), and file-related system calls. - Threads: Implement a non-busy-waiting
timer_sleepfunction, a strict priority scheduler, multi-threading support, and a simplifiedpthreadlibrary. (Note: This differs from the Multi-Level Feedback Queue requirements in the PKU Pintos and Stanford CS212 versions). - File Systems: Implement a kernel Buffer Cache, extensible files, and subdirectories.
- User Programs: Implement argument parsing for process execution, process-related system calls (including the
- 6 Homeworks: Includes a sub-task for the MapReduce assignment. Both HTTP and MapReduce assignments have two versions: C and Rust. Except for the Memory lab, most Homeworks lack local autograders (though most can be manually tested effectively, except for MapReduce, which can be replaced by the MIT 6.824 MapReduce lab).
- List: Familiarize with the built-in linked list structure in Pintos.
- Shell: Implement a Shell supporting directory commands, program execution, path parsing, redirection, pipes, and signal handling.
- HTTP: Implement an HTTP server supporting GET requests.
- Memory: Implement memory management functions like
sbrkandmalloc. - MapReduce: Implement a fault-tolerant MapReduce system (including the RPC Lab).
Personal Resources
All resources and assignment implementations (including code, design documents, and starter code) used during my study of the Fall 2025 semester are summarized in the @RisingUppercut/CS162-fall25 - GitHub repository.
Since the Operating System Course at PKU uses the project, my implementation is not open source to prevent plagiarism.