Skip to content

Repository files navigation

CS:APP Labs

Computer Systems: A Programmer's Perspective (3rd ed.) · CMU 15-213

Lab solutions with source-backed design walkthroughs.


Every completed solution below is checked against the lab's actual grader; the result is shown in the table and at the top of each writeup.

# Lab Focus Result Writeup
01 Data Lab Bit manipulation, integer & float encoding 36/36 Notes →
02 Bomb Lab Reverse engineering · GDB · x86-64 6 + secret Notes →
03 Attack Lab Buffer overflow · code injection · ROP 5/5 Notes →
04 Cache Lab LRU cache simulator · blocked transpose 53/61 Notes →
05 Shell Lab Processes · signals · job control 16/16 Notes →
06 Malloc Lab Allocator · segregated free lists 97/100 Notes →
07 Proxy Lab Concurrent, caching HTTP proxy 70/70 Notes →
08 SFS Lab (AI-assisted) On-disk file system · fine-grained locking 22/22 Notes →
A few design highlights
  • Data Lab — every integer puzzle solved within its operator budget; floats manipulated purely at the bit level.
  • Bomb Lab — all six phases plus the hidden phase (a recursive binary-tree search).
  • Attack Lab — code injection for ctarget; a ROP chain that defeats NX and ASLR for rtarget.
  • Cache Lab — an O(E) LRU simulator; the 64×64 transpose splits each 8×8 block into four 4×4 sub-blocks, staging data in B to dodge conflict misses.
  • Shell Lab — signal masking erases the fork/addjob race; sigsuspend replaces the busy-wait in waitfg.
  • Malloc Lab — segregated explicit free lists, footer-less allocated blocks via a prev_alloc bit, and a realloc that grows in place before copying.
  • Proxy Lab — one detached worker per connection; binary-safe response relay and a reader–writer-locked approximate-LRU cache.
  • SFS Lab — explicitly AI-assisted; atomic rename and per-file locking reach 3.40× the calibrated global-mutex baseline.

The notes site

The writeups live in docs/ as an MkDocs Material site and are published to GitHub Pages automatically on every push (see .github/workflows/deploy.yml). To run it locally:

python -m venv .venv && source .venv/bin/activate
pip install mkdocs-material
mkdocs serve            # then open http://127.0.0.1:8000

Acknowledgment

Thanks to virgiling for the helpful blog that guided me through these labs.

About

CS:APP Lab Solutions

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages