01 / Reading Guide
Reading Guide
Citation
Bryant, R. E., & O'Hallaron, D. R. (2015). Computer Systems: A Programmer's Perspective (3rd ed.). Pearson.
Chapter Summary
The book has twelve chapters in three parts, plus a short appendix on error handling. The authors state their filter plainly: a topic is included only if it affects the performance, correctness or utility of user-level C programs. Chapters end with a summary and bibliographic notes, and most add homework problems. Solutions to the practice problems that appear in the text are collected at the end of each chapter.
Part I: Program Structure and Execution (Chapters 1–6)
Chapter 1: A Tour of Computer Systems
The chapter follows the life cycle of a simple "hello, world" program to introduce the main themes:
- information as bits plus context
- translation of programs by compilation systems
- the hardware organization that runs them
- caches and the storage hierarchy
- the operating system's processes, threads, virtual memory and files
- communication over networks
It ends with three recurring themes: Amdahl's Law, concurrency and parallelism, and abstraction.
Chapter 2: Representing and Manipulating Information
This chapter covers four areas:
- Information storage: hexadecimal, word sizes, byte ordering, and bit-level and logical operations in C.
- Integer representations: unsigned and two's-complement encodings, conversions, sign extension and truncation.
- Integer arithmetic.
- Floating point: IEEE representation, rounding, and floating point in C.
The authors stress the consequences for programmers, such as the sum of two positive numbers turning out negative. They note that this is the chapter readers most often find heavy. The third edition marks where the treatment turns mathematical so that those passages can be skimmed on a first reading.
Chapter 3: Machine-Level Representation of Programs
Here readers learn to read the x86-64 code a C compiler produces. Topics include:
- data movement and arithmetic
- condition codes, jumps, loops and switch statements
- procedures and the run-time stack
- arrays, structures, unions and alignment
- pointers
- using the gdb debugger
- buffer overflow and the defences against it
- floating-point code
Chapter 4: Processor Architecture
The chapter designs a simplified processor around the Y86-64 instruction set. It introduces logic design and the hardware control language HCL, then builds a sequential implementation in stages. It goes on to explain the principles and limits of pipelining and develops a five-stage pipelined implementation, covering hazards, exception handling, control logic and performance analysis.
Chapter 5: Optimizing Program Performance
This chapter starts with what optimizing compilers can and cannot do. It then removes loop inefficiencies, redundant procedure calls and unneeded memory references. After presenting a model of how modern out-of-order processors work, it covers:
- loop unrolling
- multiple accumulators and reassociation
- limiting factors such as register spilling and branch misprediction
- memory performance
- profiling
Chapter 6: The Memory Hierarchy
The chapter covers storage technologies (RAM, disks, solid state disks), locality and the memory hierarchy. It then treats cache memories: direct-mapped, set associative and fully associative caches, writes, and the performance impact of cache parameters. It closes with writing cache-friendly code and the "memory mountain" view of performance.
Part II: Running Programs on a System (Chapters 7–9)
Chapter 7: Linking
Chapter 7 covers:
- compiler drivers and static linking
- object files, symbols and symbol resolution
- relocation
- executable files and loading
- dynamic linking with shared libraries
- position-independent code
- library interpositioning
- tools for manipulating object files
Chapter 8: Exceptional Control Flow
The chapter introduces exceptions, processes, process control, signals and nonlocal jumps. The authors say that after it, readers will be able to write a simple Unix shell with job control.
Chapter 9: Virtual Memory
The chapter explains physical and virtual addressing and presents virtual memory as a tool for caching, memory management and protection. It then covers:
- address translation
- a case study of the Intel Core i7 and Linux memory system
- memory mapping
- dynamic memory allocation
- garbage collection
- common memory-related bugs in C programs
Part III: Interaction and Communication between Programs (Chapters 10–12)
Chapter 10: System-Level I/O
This chapter covers:
- Unix I/O and files
- opening, reading and writing files
- a robust I/O package for handling short counts
- file metadata and directories
- sharing files and I/O redirection
- standard I/O
It prepares for the next two chapters.
Chapter 11: Network Programming
The chapter presents the client-server model, networks and the global IP Internet, the sockets interface, web servers, and a Tiny Web Server. The authors call it a thin slice through network programming that gets to a simple web server.
Chapter 12: Concurrent Programming
The final chapter compares three approaches to concurrency: processes, I/O multiplexing and threads. It then treats shared variables, synchronization with semaphores, and using threads for parallelism. It ends with other issues: thread safety, reentrancy, races and deadlocks.
Appendix A: Error Handling
A short appendix on error handling in Unix systems and error-handling wrappers.
Key Concepts
Part I: Program Structure and Execution (Chapters 1–6)
- Two's-complement and IEEE floating-point representations: why finite bit patterns give surprising arithmetic results.
- Machine-level code and the run-time stack: how C constructs and procedures map to instructions.
- Pipelining: overlapping instruction stages, and the hazards that limit it.
- Locality and the memory hierarchy: why access patterns, not just processor speed, determine performance.
Part II: Running Programs on a System (Chapters 7–9)
- Linking and relocation: how object files and libraries become an executable.
- Exceptional control flow: exceptions, signals and processes as the source of concurrency.
- Virtual memory and dynamic allocation: address translation and the implementation of malloc and free.
Part III: Interaction and Communication between Programs (Chapters 10–12)
- Unix I/O and sockets: building blocks for network programs.
- Concurrent servers: processes, I/O multiplexing and threads compared.
- Synchronization: semaphores, races and deadlocks.
Critical Analysis
Strengths
- A clear organizing idea. The authors contrast a "builder's perspective" with a programmer's perspective and apply a single filter to every topic. That is why linking, signals and malloc are included while detailed adder or bus design is left out.
- Active learning built in. Practice problems follow new concepts, with solutions at the end of each chapter. Homework problems carry effort ratings ranging from a few minutes to a ten-hour lab. All code examples were compiled and run on Linux, and the source is available from the book's website.
- Labs from a long-running course. The preface describes the labs used with the book: data, binary bomb, buffer overflow, architecture, performance or cache, shell, malloc and proxy labs. Versions without solutions are available from the authors' site for self-study.
- Support for newcomers to C. "New to C?" notes flag points about the language, and web asides move supplementary material out of the main text.
- Flexible use. The preface maps chapters onto five course types, from a computer organization course to a systems programming course.
Limitations
- Tied to one platform. The book targets x86-64 machine code, the gcc compiler and Linux. Readers on other instruction sets will see different machine code, though the authors say the overall behaviour should be the same.
- Needs C. The authors assume familiarity with C or C++. Readers who know only Java will need extra effort, and readers who know only Python, Ruby or Perl are advised to learn C first.
- A simplified processor. Chapter 4 teaches pipelining by designing a Y86-64 processor, a reduced subset of x86-64. It is a teaching design rather than a model of a commercial processor.
- Selective by design. The authors describe the network programming chapter as a thin slice, and the filter leaves out topics such as hardware adder design.
- Dated hardware. The edition dates from 2015, and the processor and cache examples reflect machines of that period.
- Edition-sensitive exercises. CMU's course staff warn that earlier editions differ substantially, especially in assembly-language coverage. They also say the paperback/international third edition carries different practice and homework problems, some of which they criticize, and that the Kindle edition they discuss shares that problem set. These are instructor cautions, but they matter if you plan to work the exercises alongside a course.
Where It Fits in the Course
Computer Systems: A Programmer's Perspective views the machine from the software side. Several related books sit before, alongside or after it:
- Before: Petzold's Code is a narrative introduction for general readers. Nisan and Schocken's The Elements of Computing Systems builds a computer in projects from logic gates upward. Either can come before this book.
- Alongside: Harris and Harris's Digital Design and Computer Architecture, RISC-V Edition works from hardware upward and has students design a processor, so it pairs with Chapter 4 here.
- After: Hennessy and Patterson's Computer Architecture: A Quantitative Approach offers a graduate-level quantitative study of architecture. Shen and Lipasti's Modern Processor Design develops the out-of-order superscalar processors that Chapter 5 only models in outline.
How to Use This Book
The book is for computer science and engineering students who can program in C or C++ and want to understand what happens beneath their programs. No experience with hardware or assembly language is assumed.
A practical plan, following the preface's course types:
- Core for a programmer-oriented course: Chapters 1 to 3 and 5 to 9. These lead from data representation through machine code, optimization, the memory hierarchy, linking, processes and virtual memory.
- Add for a systems-programming course: Chapters 10 to 12, which build toward a concurrent web server.
- Add for a computer-organization course: Chapter 4 on processor architecture.
- Practice: do the practice problems when each concept appears and attempt the labs, in particular the data, bomb, buffer overflow, cache, shell and malloc labs. Keep a Linux machine or virtual machine at hand.
Course example: Carnegie Mellon 15-213
- Course: Carnegie Mellon 15-213/15-513/14-513 Introduction to Computer Systems, Fall 2025 (syllabus).
- Role: CS:APP3e is the primary textbook, and all reading assignments come from it. Students are expected to read the text and attempt the practice problems tied to each class's readings, which makes it a working text used alongside exercises.
- Copies: An undated CMU textbook page for 15-213/15-513 notes that copies are provided through the CMU library.
- Topics: The course topics include:
- numeric representations and bit-level arithmetic
- the relationship between C and assembly
- binary-level debugging
- processes and threads
- virtual memory
- networking
- memory and CPU performance
- security vulnerabilities
- programming tools
- synchronization
- What is read: Specific readings are set in a separate course schedule.
- Companion reference: Kernighan and Ritchie's The C Programming Language (2nd ed., 1988) is suggested as a C reference, not as an alternative systems text. The syllabus states no formal course prerequisites.
- Edition: Both CMU documents specify the third edition (Pearson, ISBN 0-13-409266-X) and prefer the hardcover.
Edition and bibliographic source
The edition listed here is the North American third edition. The authors give its release as March 2015 with a copyright date of 2016, and the citation above uses the release year. Global-edition pagination and identifiers differ. The public labs and sample chapters do not make the full textbook free.
ISBN 978-0-13-409266-9 is the 13-digit form of the 0-13-409266-X that CMU specifies, so this is the same edition used in the CMU course. CMU's citation of 2016 reflects that edition's copyright year. If you are following a course built on this book, note that CMU staff say the paperback/international printing has different practice and homework problems.
