Instructor
- Anton BurtsevWebsite aburtsev at uci at edu Office (ICS 407)
Lectures, Discussions and Office Hours
- LecturesVirtual Zoom link on Canvas Mon/Wed, 5:00pm - 6:20pm
- DiscussionsVirtual/In-person Zoom link on Canvas Office (DBH 3011) Fri, 5:00pm - 5:50pm
- Anton's Office hourVirtual Zoom link on Canvas Tue, 2:30pm - 3:30pm
- Elahe's Office hourVirtual/In-person Zoom link on Canvas Office (DBH 3013) Mon, 2:00pm - 3:00pm
- Claudio's Office hourVirtual/In-person Zoom link on Canvas Office (DBH 3015) Fri, 2:00pm - 3:00pm
Links and Resources
- Mailing ListGeneral Announcements
- PiazzaDiscussion and Questions
- GradescopeHomework Submissions
- CanvasZoom Links
- Previous YearsSpring 2020
- Xv6 SetupInstructions
- ReferencesRefereed Material
Grading Policy
- Grades weight Homeworks: 55%, Quizzes 15%, Midterm exam: 10%, Final exam: 20%
- Late homework submissionYou can submit late homework 3 days after the deadline for 60% of your grade. (Does not apply to quizzes)
Schedule
September 27
- Lecture 00 - Logistics Slides Video
- Lecture 01 - Introduction Slides
- Reading OSTEP: 2 Introduction
- Reading (optional, to help you with C) The C Programming Language(look at Chapter 5 Pointers and Arrays) by Brian Kernighan and Dennis Ritchie (first edition is freely available, second edition is in print and is available from all major bookstores)
- Source code (Hello world!) The minimal boot into "Hello word!" demo
- Source code (Hello world from Rust!) The minimal boot into Rust demo(note this is the same repo, "rust" branch)
September 29
- Lecture 02 - OS Interfaces Slides Video
- Reading xv6: Chapter 0: Operating system interfaces
- Reading OSTEP: Chapter 5: Interlude: Process API
- Video (optional) AT&T Archives: The UNIX Operating System
October 1
- Discussion 01 - Brief GDB Tutorial Slides Video
- Code used in the discussion my_prog.c
- GDB Cheat Sheet gdb-cheatsheet.pdf
October 4
- Lecture 02 - OS Interfaces (continued) Slides Video
- Lecture 03 - x86 Instruction Set Slides
- Reading xv6 Book: Appendix A: PC Hardware
- Reading x86 Assembly Guide
- Reading x86 Assembly Examples
October 6
- Lecture 04 - Calling conventions Slides Video
- Source Simple example illustrating the cdecl calling convention
- Reading PC Assembly Language. Paul A. Carter: Section 4 Subprograms (4.1 - 4.5) and Wikipedia: x86 calling conventions
-
Homework 1 GDB and simlpe UNIX programs (due Wednesday, October 13, 11:59pm Pacific Time)
October 8
- Discussion 02 - Fork, Exec, Pipe Slides Video
- Code used in the discussion discussion02-code.zip
October 11
- Lecture 05 - Linking and Loading Slides Video
- Reading Operating Systems from 0 to 1. Chapter 5. The Anatomy of a Program
- Optional reading This lecture is mostly based on the material of this book Linkers and Loaders by John R. Levine
October 13
- Lecture 05 - Linking and Loading (Position Independent Code) Slides Video
- Reading Same as above
- Reading Position Independent Code (PIC) in shared libraries
- Optional Reading Load-time relocation of shared libraries
October 15
October 18
- Lecture 06 - Address translation (Segmentation) Slides Video
- Reading IntelĀ® 64 and IA-32 architectures software developer's manual volume 3A: System programming guide, part 1 (Chapter 3: 3.1-3.4.5 and Chapter 4: 4.2-4.3)
October 20
- Lecture 06 - Address translation (Paging) Slides Video
- Reading IntelĀ® 64 and IA-32 architectures software developer's manual volume 3A: System programming guide, part 1 (Chapter 3: 3.1-3.4.5 and Chapter 4: 4.2-4.3)
- Reading OSTEP: Chapter 18 Paging: introduction: only Sections 18.1 - 18.3
- Reading OSTEP: Chapter 20: only Section 20.3 Multi-level Page Tables
October 22
- Discussion 04 - Paging and Segmentation Video
October 25
- Midterm Review Video
October 27
-
Midterm Exam examples from previous years (Wednesday, 5:00pm - 6:20pm Pacific Time)
October 28
-
Homework 3 The ELF Format (due Thursday, November 04, 11:59pm Pacific Time)
October 29
- Discussion 05 - Midterm Review Video
- Answers A correct set of solutions to the midterm.
November 1
- Lecture 07 - System Boot Slides Video
- ReadingAppendix B: The boot loader
- ReadingChapter 1: Code: the first address space
- Reading (optional)How Does an Intel Processor Boot?
- Reading (optional)Intel SGX explained (sections 2.9.1 The Motherboard, 2.9.2 The Intel Management Engine (ME), and 2.13 Platform Initialization (Booting))
November 3
- Lecture 08 - System Init Slides Video
- ReadingChapter 1: Operating system organization
- ReadingChapter 2: Page tables
November 5
- Discussion 06 - Booting Slides Video
-
Homework 4 Boot Into C (due Friday, November 12, 11:59pm Pacific Time)
November 8
- Lecture 08 - System Init (continued) and Lecture 09 - Interrupts Slides Slides Video
- ReadingChapter 3: Traps, interrupts and drivers
November 10
- Lecture 09 - Interrupts (Continued) Slides Video
- ReadingChapter 3: Traps, interrupts and drivers
November 12
- Discussion 07 - HW4 Video
November 15
- Lecture 09 - Interrupts (Continued, System Calls) and Lecture 10 - Creating processes Slides Slides Video
- ReadingChapter 2: Page tables
November 17
- Lecture 10 - Creating processes (continued) Slides Video
- ReadingChapter 2: Page tables
November 22
- Lecture 11 - Context Switch Slides Video
- ReadingChapter 1. Subsection: Running the first process, Chapter 5 - Scheduling (up until Drivers)
November 24
- Lecture 12 - Synchronization Slides Video
- Readingxv6: Chapter 4: Locking and synchronization
November 26
-
Homework 5 Adding a System Call (due Sunday, December 05, 11:59pm Pacific Time)
November 29
- Lecture 13 - File System Slides Video
- Readingxv6: Chapter 6: File System ReadingOSTEP: Chapter 40: File System Implementation
December 1
December 8
-
Final Exam examples from previous years (Wednesday, 10:30am - 12:30pm Pacific Time)
Class overview
238P teaches the fundamentals of operating systems. You will study, in detail, virtual memory, kernel and user mode, system calls, threads, context switches, interrupts, interprocess communication, coordination of concurrent activities, and the interface between software and hardware. Most importantly, you will study the interactions between these concepts, and how to manage the complexity introduced by the interactions.
To master the concepts, 238P is organized in as a series of lectures, and homeworks. The lectures (and the book readings) familiarize you with the main concepts. The homrworks force you to understand the concepts at a deep level.
The lectures are based on xv6 (x86 version 6), which is a modern re-implementation of one of the early UNIX operating systems, specifically Unix Version 6 which was developed in the 1970s, on the modern hardware. xv6 is only 9,000 lines of C code, but it can run real processes, and perform many functions of a traditional operating system, e.g., Windows, Linux, and Mac OS. Due to its small size, it is possible to read the source code and understand the entire operating system. Moreover, xv6 is accompanied by a book describing its architecture (and a printout of its source code). Homework assignments will help you to deepen the understanding of the principles and internal organization of a simple, but real operating system.
You may wonder why we are studying an operating system that resembles Unix v6 instead of the latest and greatest version of Linux, Windows, or BSD Unix. xv6 is big enough to illustrate the basic design and implementation ideas in operating systems. On the other hand, xv6 is far smaller than any modern production operating systems, and correspondingly easier to understand. xv6 has a structure similar to many modern operating systems; once you've explored xv6 you will find that much is familiar inside kernels such as Linux.
Prerequisites
- Xv6 is implemented in C, so you're expected to be familiar with the C programming language.
- Xv6 runs in the QEMU simulator and on bare-metal. You're expected to be familiar with the basics of Linux environment.
Books
The class is based on two books that are freely available from the authors:
- Operating Systems: Three Easy Pieces(free, available online). Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau
- Xv6 a Simple, Unix-like Teaching Operating System(free, available online). Russ Cox, Frans Kaashoek, Rober Morris