< CSAPP />

Computer Systems: A Programmer's Perspective

// Understanding Computer Systems from a Programmer's Viewpoint

bash — 80x24
$ cat learning_progress.txt # CSAPP Learning Progress Tracker const char* mission = "Understanding computer system fundamentals"; int lectures_completed = 15; bool ongoing = true; $ echo "Keep learning, keep hacking!"

Course Content

Lecture 1

A Tour of Computer Systems

Explore the fundamental architecture of computer systems, understanding the relationship between information, hardware, and programs. Includes a classic Hello World compilation process demonstration.

View Notes Source Code
Lecture 2-3

Representing and Manipulating Information: Integers

Master bit-level operations and integer representations: two's complement encoding, signed/unsigned conversions, arithmetic operations with overflow handling, sign extension, and practical bit manipulation techniques including shift operations and Boolean algebra applied to bit vectors.

View Notes Source Code
Lecture 4

Representing and Manipulating Information: Floating Points

Explore floating-point number representation and normalized/denormalized numbers. Learn about rounding modes, floating-point arithmetic (addition/multiplication), and practical C programming with floating-point numbers.

View Notes Source Code
Lecture 5

Machine Level Programming I: Basics

Dive into x86-64 assembly programming fundamentals: understand the compilation process from C to machine code, explore programmer-visible state (registers, program counter, memory), master data movement instructions, addressing modes, and arithmetic/logical operations including the powerful leaq instruction for optimization.

View Notes Source Code
Lecture 6

Machine Level Programming II: Control

Master advanced control flow in x86-64 assembly: condition codes (CF, ZF, SF, OF), conditional branches with setX and jX instructions, and conditional moves for branch prediction optimization. Learn loop implementations (do-while, while, for) and switch statements using jump tables for efficient multi-way branching.

View Notes Source Code
Lecture 7

Machine Level Programming III: Procedures

Master procedure calls and stack frames in x86-64 assembly. Learn ABI (Application Binary Interface) specifications, stack structure and operations (push/pop), calling conventions for control and data transfer. Understand register conventions (caller-saved vs callee-saved), stack frame management, and how recursion is implemented using the stack mechanism.

View Notes Source Code
Lecture 8-9

Machine Level Programming IV & V: Data and Advanced Topics

Explore advanced data structures in assembly: arrays (1D, nested, multi-level, and variable-length), structs with alignment requirements, linked lists, and unions. Understand memory layout principles, buffer overflow vulnerabilities, and floating-point representation in x86-64 assembly.

View Notes Source Code
Lecture 10

Program Optimizations

Master program optimization techniques from multiple levels: code motion (loop invariant code motion), reduction in strength, and sharing common subexpressions. Understand optimization blockers like procedure calls and memory aliasing. Explore instruction-level parallelism through modern CPU superscalar processors, pipelining, loop unrolling, parallel accumulation, and branch prediction strategies.

View Notes Source Code
Lecture 11-12

Memory Hierarchy and Caches

Deep dive into memory hierarchy: storage technologies (SRAM/DRAM/SSD/Disk), locality principles (temporal & spatial), cache organization, and performance optimization through code restructuring to improve cache utilization and program efficiency.

View Notes Source Code
Lecture 14-15

Execeptional Control Flow

Master exceptional control flow mechanisms: exceptions (traps, faults, aborts, interrupts), process creation and management using fork, wait, and execve system calls. Understand process control flow, context switching, concurrent execution, zombie and orphan processes, and process graphs for modeling multi-process program behavior.

View Notes Source Code

Lab Assignments

Lab 1

Data Lab ✅

Manipulate bits using bitwise operations and implement functions following strict coding rules. Learn about two's complement, floating-point representation, and bit-level operations.

View Lab
Lab 2

Bomb Lab ✅

Defuse a "binary bomb" by understanding assembly language and using a debugger. Learn about stack frames, registers, and machine-level programming.

View Lab
Lab 3

Attack Lab

Understand and exploit buffer overflow vulnerabilities. Learn about code injection attacks, ROP (Return-Oriented Programming), and system security.

View Lab
Lab 4

Cache Lab

Build a cache simulator and optimize matrix transpose for cache performance. Deep dive into memory hierarchy, cache organization, and performance optimization.

View Lab
Lab 5

Shell Lab

Build your own Unix shell (tsh) by implementing process control, signal handling, and job control. Learn about exceptional control flow, process creation, and Unix system calls.

View Lab
Lab 6

Malloc Lab

Implement your own dynamic memory allocator (malloc/free). Understand virtual memory, heap management, allocation strategies, and memory optimization techniques.

View Lab
Lab 7

Proxy Lab

Build a concurrent web proxy server handling HTTP requests. Learn about network programming, socket API, concurrency, and web protocol implementation.

View Lab