The textbook for the course is Computer Systems: A Programmer’s Perspective, Third Edition (also known as CS:APP3e) by Randal E. Bryant and David R. O’Hallaron. Pearson, 2015, ISBN 978-0134092669.
The textbook is long, but comprehensive, and past students have found it very useful as reference during the class. It is strongly recommended that you obtain a copy of this textbook. It may be purchased at the Harvard Coop, or from one of many online bookstores.
- CS:APP3e textbook web page
- Harvard Coop textbook list
- CS:APP3e on Amazon
- CS:APP3e on bookfinder (searches multiple online book sellers)
We do not recommend using the 2nd edition of CS:APP, because that edition is based on a different computer architecture (32-bit x86, not 64-bit x86-64). International editions of CS:APP3e are likely to be OK.
The rest of this page lists specific textbook sections relevant for the units of our class.
Unit 1: Data representation
- General: §1.1–1.4
- Integer representation: §2.1–2.2
- Compound type representation (arrays, structures, unions): §3.8–3.9
- Integer arithmetic: §2.1
- Pointer arithmetic: none (§3.8.2 from a Unit 2 perspective)
- Dynamic memory allocation: §9.9 (includes an implementation of a dynamic memory allocator)
- Segments: §9.9.0 (briefly; §3.7 discusses stacks from a Unit 2 perspective)
- Memory bugs: §9.11 (§3.10.3 from a Unit 2 perspective)
- Undefined behavior: Not covered in the textbook (in fact the textbook
contains misstatements about integer overflow)
- Wikipedia
- “A Guide to Undefined Behavior in C and C++” 1, 2, 3 by John Regehr, professor at Utah
- “What Every C Programmer Should Know About Undefined Behavior” 1, 2, 3 by Chris Lattner, Clang developer
Other topics
- Floating point representation: §2.4
- Garbage collection: §9.10
Unit 2: Assembly & machine programming
- General: §1.4, §3.0–3.2
- Arithmetic and logical instructions: §3.5
- Data movement instructions: §3.3–3.4
- Control flow instructions: §3.6
- Calling convention: §3.7
- Compiler optimizations: §5–5.6, §5.14
Unit 3: Kernel
- General: §1.7
- Exceptions and protected control transfer: §8.1, §8.3
- Process isolation, system calls, and kernel privilege: §8.2
- Virtual memory in general: §9–9.1
- Virtual memory for isolation: §9.5
- Address spaces: §9.2
- Page tables: §9.3.2, §9.6, §9.7
- Semantics of
fork
: §8.4.2 - Implementation of
fork
: §9.8.2
Unit 4: Storage
- General: §1.5–1.6
- Memory hierarchy, storage technologies, locality: §6
- List of caches by latency: §6.3
- Processor caches: §5.12
- File I/O: §10.1–10.4
- Standard I/O: §10.10
- Implementation of an alternate I/O package: §10.5
- Virtual memory for caching (buffer cache): §9.3
Unit 5: Process control
- General: §1.7
- Creating and destroying processes: §8.4
- Simple shell with
fork
andexecve
: §8.4.6
- Simple shell with
- Sharing files and I/O redirection: §10.8–10.9
- Concurrent programming with processes: §12.1–12.2
- Signals: §8.5
- Process groups: §8.5.2
Unit 6: Synchronization
The textbook material on synchronization is worth scanning, but it is not as strong as the other units.
- General: §12
- Threads: §12.3
- Thread safety: §12.7