Skip to content
Operating Systems
07: Scheduling
Initializing search
cs-pub-ro/operating-systems
Home
Live
Full
Info
Assignments
Extra
Operating Systems
cs-pub-ro/operating-systems
Home
Live
Live
Lectures
Lectures
01: The Software Stack
01: The Software Stack
Demos
Demos
Pitch: Four Small Surprises
Pitch: Four Small Surprises
Demo: Two Ways to Build the Same String
Demo: char *str and char str[]
Demo: The Same Command, Three Times
Demo: An Assignment That Does Nothing
Demo: Hello, World at Five Heights
Demo: What a Security Guarantee Costs
Demo: Four Containers, Three Protocols
Slides
02: OS Types and the OS Interface
02: OS Types and the OS Interface
Demos
Demos
Demo: The Kernel Does the Heavy Lifting
Demo: Building an Operating System
Demo: Building an Operating System
Demo: Build Hello, World with Unikraft
Demo: The System Call Interface
Demo: The System Call Interface
Demo: What a System Call Costs
Demo: Talking to the Kernel Directly
Demo: Privileged Instructions Fault in User Mode
Demo: Optimizing the OS Interface
Demo: Optimizing the OS Interface
Demo: Buffering in User Space
Demo: Moving Work into the Kernel with sendfile()
Slides
03: Memory Operations
03: Memory Operations
Demos
Demos
Demo: Why Care About Memory?
Demo: Why Care About Memory?
Demo: Memory You Do Not See Is Working for You
Demo: Where Data Sits Decides Speed
Demo: Memory You Forget to Free Is Gone
Demo: Memory Is What Runs Out
Demo: Memory Operations
Demo: Memory Operations
Demo: The Five Operations
Demo: Permissions Are Per Area
Demo: The Process Address Space
Demo: The Process Address Space
Demo: The Address Space, Line by Line
Demo: When Memory Is Allocated
Demo: When Memory Is Allocated
Demo: Where Every Kind of Variable Lives
Demo: Run-Time Allocation
Demo: Run-Time Allocation
Demo: Watching the Dynamic Areas Change
Demo: What malloc() Asks the Kernel For
Slides
04: Virtual Memory
04: Virtual Memory
Demos
Demos
Demo: Addresses Are Not Places
Demo: Addresses Are Not Places
Demo: Allocate 10 TB
Demo: A Browser With 1.5 TB of Memory
Demo: The Same Address, Twice
Demo: What We Already Know
Demo: What We Already Know
Demo: malloc() Under strace
Demo: Allocation Changes the List of Areas
Demo: Virtual Memory and Physical Memory
Demo: Virtual Memory and Physical Memory
Demo: Reserving Costs Nothing
Demo: Two Sizes for Every Process
Demo: Reserve, Allocate, Map
Demo: Reserve, Allocate, Map
Demo: One Fault per Page, Once
Demo: Touch Half, Pay for Half
Demo: Pages and the Page Table
Demo: Pages and the Page Table
Demo: Reading Your Own Page Table
Slides
05: Paging
05: Paging
Demos
Demos
Demo: Billions of Faults
Demo: Billions of Faults
Demo: Ten Billion Page Faults
Demo: More Resident Memory Than Memory
Demo: Two Views of One Address Space
Demo: Two Views of One Address Space
Demo: Which View Each Step Edits
Demo: One Address Space, Counted Both Ways
Demo: The Page Fault
Demo: The Page Fault
Demo: Minor and Major, on the Same File
Demo: Eight Accesses, Two Kinds of No
Demo: Where Frames Come From
Demo: Where Frames Come From
Demo: The Page Cache
Demo: Swap, in a Box
Demo: Memory Sharing
Demo: Memory Sharing
Demo: fork() and Copy-on-Write
Demo: RSS, PSS and USS for One Process
Demo: Ten Processes, Four Ways
Demo: Storing the Page Table
Demo: Storing the Page Table
Demo: How Much Page Table a Process Has
Demo: What a TLB Miss Costs
Slides
06: Processes and Threads
07: Scheduling
08: Concurrency
09: I/O Interface
10: Inter-Process Communication
11: Network I/O
12: Inter-Application Interaction
Labs
Labs
01: The Software Stack
01: The Software Stack
Demo: Copy String
Demo: printf vs write
01: Implement strlen(), strcpy(), strcat(), memcpy()
02: XOR Encryption — Build and Use a Library
03: Stream Ciphers — Four Ways to Link the Same Program
Bonus: Stream Ciphers — One Executable per Cipher
Bonus: Make Your Own Library — Static vs Dynamic Linking
02: The Operating System Interface
02: The Operating System Interface
Demo: The write System Call
01: The getpid System Call
02: The nanosleep System Call
Bonus: clock_gettime and time
Bonus: Plugging _putchar() Into a Custom printf
03: Memory Operations
03: Memory Operations
Demo: Copy a File Using a Global Buffer
Demo: Copy a File Using a Local Buffer
Demo: Copy a File Using a Heap Buffer
Demo: Copy a File Using an mmap Buffer
01: XOR-Encrypt a File With a Fixed Key
02: Sort Products by Price
03: A Growable In-Memory Database
04: Reverse the Lines of a File
Bonus: A Shrinking In-Memory Database
Bonus: Tune malloc() for a Frame Pipeline
04: Memory Debugging
04: Memory Debugging
Demo: Debugging an In-Memory Database
Demo: Finding a Memory Leak With Valgrind
01: The Config Parser That Forgets
02: The Program That Is Right and Still Broken
03: The Histogram That Counts Too Much
04: The Report That Crashes in the C Library
Bonus: The JSON Parser With a Heap Buffer Overflow
Bonus: (Hard) No Source Code Allowed
Bonus: (Hard) The Symbol Table With Two Bugs
05: Memory Security
05: Memory Security
Demo: Flip the Lock (heap-0)
Demo: Set the Access Level (heap-1)
01: Overflow a Heap Buffer (heap-0)
02: Overflow to an Exact Value (heap-1)
03: Hijack a Function Pointer (heap-2)
04: Use-After-Free (heap-3)
Bonus: Cross Two Structs (heap-havoc)
Bonus: Leak and Overflow a PIE (heap-mayhem)
Bonus: A pwntools Primer
06: Processes and Threads
06: Processes and Threads
Demo: A Minimal Shell
Demo: Searching a File With Several Threads
01: A Shell With Arguments and Chaining
02: Adding Up What the Threads Found
03: Encrypting Files in Batches
Bonus: Background Processes
Bonus: The Last Batch Is Smaller
07: Parallelizing Execution
08: Troubleshooting Concurrency
09: The I/O Interface. File I/O
10: Pipes and Redirection
11: Socket IPC
12: CTF
Full
Full
Lectures
Lectures
01: The Software Stack
01: The Software Stack
Demos
Demos
Pitch: Four Small Surprises
Pitch: Four Small Surprises
Demo: Two Ways to Build the Same String
Demo: char *str and char str[] Are Not the Same Declaration
Demo: The Same Command, Three Times, Fifteen Times Faster
Demo: Python Strings Are Immutable, Except When It Would Be Slow
Demo: Hello, World at Five Heights of the Stack
Demo: What a Security Guarantee Costs
Demo: A Web Application Is Four Programs Talking
Demo: A Web Application Is Four Programs Talking
Dockerized Wordpress with NGINX web server & MariaDB
Slides
02: Operating System Types and the OS Interface
02: Operating System Types and the OS Interface
Demos
Demos
Demo: The Kernel Does the Heavy Lifting
Demo: Building an Operating System
Demo: Building an Operating System
Demo: Build Hello, World with Unikraft
Demo: The System Call Interface
Demo: The System Call Interface
Demo: What a System Call Costs
Demo: Talking to the Kernel Directly
Demo: Privileged Instructions Fault in User Mode
Demo: Optimizing the OS Interface
Demo: Optimizing the OS Interface
Demo: Buffering in User Space
Demo: Moving Work into the Kernel with sendfile()
Slides
03: Memory Operations
03: Memory Operations
Demos
Demos
Demo: Why Care About Memory?
Demo: Why Care About Memory?
Demo: Memory You Do Not See Is Working for You
Demo: Where Data Sits Decides Speed
Demo: Memory You Forget to Free Is Gone
Demo: Memory Is What Runs Out
Demo: Memory Operations
Demo: Memory Operations
Demo: The Five Operations
Demo: Permissions Are Per Area
Demo: The Process Address Space
Demo: The Process Address Space
Demo: The Address Space, Line by Line
Demo: When Memory Is Allocated
Demo: When Memory Is Allocated
Demo: Where Every Kind of Variable Lives
Demo: Run-Time Allocation
Demo: Run-Time Allocation
Demo: Watching the Dynamic Areas Change
Demo: What malloc() Asks the Kernel For
Slides
04: Virtual Memory
04: Virtual Memory
Demos
Demos
Demo: Addresses Are Not Places
Demo: Addresses Are Not Places
Demo: Allocate 10 TB
Demo: A Browser With 1.5 TB of Memory
Demo: The Same Address, Twice
Demo: What We Already Know
Demo: What We Already Know
Demo: malloc() Under strace
Demo: Allocation Changes the List of Areas
Demo: Virtual Memory and Physical Memory
Demo: Virtual Memory and Physical Memory
Demo: Reserving Costs Nothing
Demo: Two Sizes for Every Process
Demo: Reserve, Allocate, Map
Demo: Reserve, Allocate, Map
Demo: One Fault per Page, Once
Demo: Touch Half, Pay for Half
Demo: Pages and the Page Table
Demo: Pages and the Page Table
Demo: Reading Your Own Page Table
Slides
05: Paging
05: Paging
Demos
Demos
Demo: Billions of Faults
Demo: Billions of Faults
Demo: Ten Billion Page Faults
Demo: More Resident Memory Than Memory
Demo: Two Views of One Address Space
Demo: Two Views of One Address Space
Demo: Which View Each Step Edits
Demo: One Address Space, Counted Both Ways
Demo: The Page Fault
Demo: The Page Fault
Demo: Minor and Major, on the Same File
Demo: Eight Accesses, Two Kinds of No
Demo: Where Frames Come From
Demo: Where Frames Come From
Demo: The Page Cache
Demo: Swap, in a Box
Demo: Memory Sharing
Demo: Memory Sharing
Demo: fork() and Copy-on-Write
Demo: RSS, PSS and USS for One Process
Demo: Ten Processes, Four Ways
Demo: Storing the Page Table
Demo: Storing the Page Table
Demo: How Much Page Table a Process Has
Demo: What a TLB Miss Costs
Slides
06: Processes and Threads
07: Scheduling
08: Concurrency
09: I/O Interface
10: Inter-Process Communication
11: Network I/O
12: Inter-Application Interaction
Labs
Labs
01: The Software Stack
01: The Software Stack
Demo: Copy String
Demo: printf vs write
01: Implement strlen(), strcpy(), strcat(), memcpy()
02: XOR Encryption — Build and Use a Library
03: Stream Ciphers — Four Ways to Link the Same Program
Bonus: Stream Ciphers — One Executable per Cipher
Bonus: Make Your Own Library — Static vs Dynamic Linking
02: The Operating System Interface
02: The Operating System Interface
Demo: The write System Call
01: The getpid System Call
02: The nanosleep System Call
Bonus: clock_gettime and time
Bonus: Plugging _putchar() Into a Custom printf
03: Memory Operations
03: Memory Operations
Demo: Copy a File Using a Global Buffer
Demo: Copy a File Using a Local Buffer
Demo: Copy a File Using a Heap Buffer
Demo: Copy a File Using an mmap Buffer
01: XOR-Encrypt a File With a Fixed Key
02: Sort Products by Price
03: A Growable In-Memory Database
04: Reverse the Lines of a File
Bonus: A Shrinking In-Memory Database
Bonus: Tune malloc() for a Frame Pipeline
04: Memory Debugging
04: Memory Debugging
Demo: Debugging an In-Memory Database
Demo: Finding a Memory Leak With Valgrind
01: The Config Parser That Forgets
02: The Program That Is Right and Still Broken
03: The Histogram That Counts Too Much
04: The Report That Crashes in the C Library
Bonus: The JSON Parser With a Heap Buffer Overflow
Bonus: (Hard) No Source Code Allowed
Bonus: (Hard) The Symbol Table With Two Bugs
05: Memory Security
05: Memory Security
Demo: Flip the Lock (heap-0) — Solution
Demo: Set the Access Level (heap-1) — Solution
01: Overflow a Heap Buffer (heap-0) — Solution
02: Overflow to an Exact Value (heap-1) — Solution
03: Hijack a Function Pointer (heap-2) — Solution
04: Use-After-Free (heap-3) — Solution
Bonus: Cross Two Structs (heap-havoc) — Solution
Bonus: Leak and Overflow a PIE (heap-mayhem) — Solution
Bonus: A pwntools Primer — Full
06: Processes and Threads
06: Processes and Threads
Demo: A Minimal Shell
Demo: Searching a File With Several Threads
01: A Shell With Arguments and Chaining
02: Adding Up What the Threads Found
03: Encrypting Files in Batches
Bonus: Background Processes
Bonus: The Last Batch Is Smaller
07: Parallelizing Execution
08: Troubleshooting Concurrency
09: The I/O Interface. File I/O
10: Pipes and Redirection
11: Socket IPC
12: CTF
Info
Info
How the Lab Works
Resources
Resources
QEMU Guide (MacOS)
UTM Guide (MacOS)
Rules and Grading (2026-2027)
Assignments
Assignments
ELF Loader Assignment
Mini-libc
Minishell
Extra
Session 07: Scheduling - Full Contents
¶
Back to top