In 1976, a professor at the University of New South Wales wrote some lecture notes. They became the most photocopied document in computer science history. Then AT&T tried to destroy them, and accidentally created the exact opposite of what it intended.
John Lions didn’t set out to write a banned book. He was an operating systems instructor who believed his students needed to read actual kernel code, not just theory. The result was a two-volume work that circulated through an underground network of photocopiers for two decades before it was legally published. It’s a story about licensing insanity, architectural clarity, and why “you are not expected to understand this” became one of the most famous comments in software history.

The Textbook That Became Contraband
Lions printed his commentary as two volumes with red cardboard covers and the UNSW crest. The set carried the title Source Code and Commentary on Unix Level 6: a formatted listing of the Unix Version 6 kernel, plus the commentary volume proper. The first printing was literally computer printout on continuous fanfold paper. Lions joked the whole thing was “not unreasonably transportable in a student’s briefcase”, which was his way of saying it was heavy but worth carrying.
He had reordered the source listing so related code sat together, initialisation and process management, interrupts and system calls, basic I/O, file systems, pipes and character devices, with every procedure and symbol in an alphabetical cross-reference. This wasn’t just a transcription. It was a map of how the system worked, organized for learning rather than compilation.
By 1977, the notes were circulating among other schools and research institutions with Unix licenses. Even Bell Labs wanted copies and eventually took over distribution. For a brief window, Unix source code could be studied openly in classrooms.
Then came June 1979.
AT&T’s License Change Backfired Spectacularly
At the USENIX meeting in Toronto, AT&T lawyer Al Arms told roughly 400 attendees that the academic and research license for the new Version 7 of Unix would no longer automatically permit classroom use. The license terms allowed exactly one printed copy of Lions’ commentary per Unix license and barred using the source code as a course text.
Greg Rose, then a Lions student at UNSW, described the result: “It seems that in so many stages of Unix’s evolution, action that AT&T took to stifle something actually caused the opposite to happen. Suppressing Lions’ commentary led to wholesale Xeroxing.”
This is the classic licensing paradox that keeps repeating across the industry. The restriction didn’t stop people from reading the code. It just made the process more expensive, more error-prone, and more exciting. Students met at night in empty classrooms to discuss the book because it couldn’t legally be discussed in class. One student later told the Sydney Morning Herald that it was the only period of his life he was active in an underground.
The “revolutionary” licensing policy mostly revolutionized the photocopying industry.
Why a 29 KB Kernel Could Teach More Than a 100 MB One
The Unix Sixth Edition kernel was about 29 KB. The entire system came in under 10,000 lines of C and assembly code. Compare that to a modern Linux kernel, which is pushing 30 million lines. There’s a reason MIT’s operating systems course used the Sixth Edition source code and why xv6 continues that lineage today.
A kernel that size is small enough to finish. No current kernel offers that possibility. You can read the whole thing. You can understand the whole thing. You can see how scheduling, buffering, and file systems work from inside rather than from a diagram.
But reading raw kernel code is brutal without guidance. Here’s the top of sleep(), which puts a process to sleep on a channel until something wakes it:
sleep(chan, pri)
{
register *rp, s;
s = PS->integ;
rp = u.u_procp;
if(pri >= 0) {
if(issig())
goto psig;
spl6();
rp->p_wchan = chan;
rp->p_stat = SWAIT;
rp->p_pri = pri;
spl0();
if(runin != 0) {
runin = 0;
wakeup(&runin);
}
swtch();
}
Four things in nine lines would stop a modern reader cold:
- There’s no return type and no parameter type, because pre-ANSI C assumed
int. - There are no prototypes, so nothing checks that
chanis a channel pointer rather than a count. registerrequests the compiler to keeprpandsin machine registers, which mattered on a machine with the memory of a PDP-11.spl6()andspl0()raise and lower the processor interrupt priority, bracketing the window where the process gets placed on a wait channel.
The control flow is worse. goto psig jumps to a label at the bottom of the function that calls aretu(u.u_qsav), a non-local jump back to a saved context in the trap handler. Lions’ notes exist to tell you that, and to tell you why the priority argument decides whether signals get processed. Without them, the function is readable in the way a legal contract in a second language is readable.
“You Are Not Expected to Understand This”
The most famous passage in the book isn’t even Lions’ writing. It’s Bell Labs’ own comment inside swtch(), at line 325 of usr/sys/ken/slp.c:
/*
* If new process paused because it was
* swapped out, set stack level to last call
* to savu(u_ssav). This means that the return
* which is executed immediately after the call to aretu
* actually returns from the last routine which did
* savu.
*
* You are not expected to understand this.
*/
if(rp->p_flag & SSWAP) {
rp->p_flag =& ~SSWAP;
aretu(u.u_ssav);
}
The code depends on how the PDP-11 C compiler saved registers across procedure calls. aretu switches to a saved stack frame so that a return executed later unwinds to the caller of savu. The construction broke when Unix was ported to other machines and was redesigned in Version 7.
Ritchie later said the line was meant in the spirit of “This won’t be on the exam” rather than as a challenge. But Lions reproduced it because his job was to explain what the authors left unexplained. That’s the difference between documentation and a reference manual. Documentation tells you what the code does. A reference manual tells you what the code is supposed to do. Lions’ commentary was the former, written by someone who understood that the gap between those two things is where the real architecture lives.
This principle matters today more than ever. When we look at system design failures despite massive investment, the common thread isn’t a lack of code. It’s a lack of people who can explain the code clearly. Lions’ value wasn’t in the source code, AT&T owned that. His value was in the annotations, and those couldn’t be licensed away.
The Photocopy Chain and What It Preserved
The 1996 reissue’s introduction notes that the book is suspected of being the most frequently photocopied text in computer science. Between 1979 and 1996, copies moved through a chain of trust: passed between campuses, photocopied from photocopies, later posted as plain text on Usenet.

Copying cost readers something concrete. Greg Lehey, who maintains an edition built from the text Warren Toomey posted to the alt.folklore.computers newsgroup in May 1994, notes that the errors still turning up in it are mainly scan errors. Each generation removed from a clean printout lost characters in listings where one character decides whether a program compiles. A student debugging against a corrupted listing couldn’t tell a typo from a bug in the kernel. That’s not a theoretical problem, that’s a debugging nightmare that would make modern developers run screaming back to their type-safe languages.
What survived wasn’t the text. It was the habit the course taught. Lucy Chubb, later president of the Australian Unix and Open Systems Users Group, said that serious reading of someone else’s code was something no other subject gave them. Peter Reintjes produced a line that outlived the volumes: “We had acquired what amounted to literary criticism of computer software.”
That’s the architectural lesson hiding in plain sight. The most important thing about an architecture isn’t the architecture itself. It’s whether anyone can understand it well enough to explain it, critique it, and improve it. The photocopy chain preserved the practice of deep code reading, not just the code.
The Economics of Secrecy
Here’s the part that should make modern engineering leaders uncomfortable: the secrecy didn’t suppress demand. It created a black market. And the black market changed what the document was.
When a book is freely available, it’s a reference. When it’s contraband, it’s a badge of belonging. Students who met at night in empty classrooms to discuss kernel code weren’t just learning, they were joining a community. The illegality created a shared experience that a legal textbook could never replicate.
The timeline makes this clear:
| Date | Event |
|---|---|
| May 1975 | Sixth Edition ships for PDP-11, kernel about 29 KB |
| May 1976 | Lions assembles the two volumes as UNSW course notes |
| March 1977 | UNIX News announces the book to Unix licensees |
| June 1979 | Al Arms announces Version 7 terms at USENIX Toronto |
| May 1994 | Toomey posts the Commentary to Usenet |
| 1996 | SCO authorizes the code, Peer-to-Peer reprints both volumes |
| 2002 | PDP-11 Unix and 32V move to a BSD-style license |
The reprint happened because people like Peter H. Salus, Dennis Ritchie, and Berny Goodheart kept asking AT&T, Novell, and the Santa Cruz Operation for permission. SCO finally agreed. Peer-to-Peer Communications published the official edition in 1996 with a foreword by Ritchie.
The timing kills the obvious explanation. If the reprint happened because demand had finally become undeniable, the text would have been unavailable beforehand. It was available, Toomey posted it to Usenet two years before the legal edition. Demand was never the constraint. The constraint was institutional inertia and a licensing structure that made no sense for teaching materials.
Andrew Tanenbaum’s answer was to write a system he could teach from. He said so in Operating Systems in 1987: Version 7 arrived with a license that prohibited source code from being studied in courses, so universities complied by dropping the study of Unix and teaching only theory. Minix came out of that gap. The licensing decision directly spawned one of the most influential teaching operating systems ever created.
AT&T managed to turn Unix source code into a controlled substance and then wondered why everyone wanted it.
What the 1996 Reprint Actually Changed
Reprinting the book didn’t settle the code. Between 1996 and 2002, a reader could own a lawful copy of a commentary on the kernel without a clear right to redistribute the kernel it printed. The PDP-11 versions and 32V only moved to an open BSD-style license in 2002.
Thompson’s verdict on the book itself, given to Salon in 1999: “After 20 years, this is still the best exposition of the workings of a ‘real’ operating system.”
That’s a strong statement from one of the people who wrote the code being explained. It’s also a reminder that architectural excellence and explanatory excellence are different skills. Unix was architecturally excellent. Lions’ commentary was explanatorily excellent. The combination was unstoppable, which is exactly why AT&T tried to suppress it.
The 1996 edition carried contributions from Michael Tilson, Peter Salus, Ritchie, Ken Thompson, Peter Collinson, Greg Rose, and Berny Goodheart. The original two-volume set had circulated for almost twenty years. The official edition is now a historical artifact, available as a reconstructed PDF or a print copy on Amazon.
Reading a 29 KB Kernel in 2026
Lions’ methods are alive in places you might not expect. MIT’s operating systems course used the Sixth Edition source for exactly this reason in its Fall 2006 version, and xv6 continues that lineage today. The Unix Heritage Society hosts the V6 source tree and the full history is available on GitHub.
You can rebuild Lions’ alphabetical index of procedures with a modern toolchain:
# --depth 1 skips roughly 2 GB of history in this repo.
git clone --depth 1 --branch Research-V6 https://github.com/dspinellis/unix-history-repo.git
cd unix-history-repo
# Lions indexed every procedure alphabetically. Rebuild that index.
for f in usr/sys/*/*.c, do
awk '/^[a-z_][a-z0-9_]*\(/ { name = $0, sub(/\(.*/, "", name), print name "\t" FILENAME }' "$f"
done | grep -vE '^(if|for|while|switch|return|sizeof)' | sort -u
# Expected output (excerpt):
# newproc usr/sys/ken/slp.c
# sched usr/sys/ken/slp.c
# sleep usr/sys/ken/slp.c
# swtch usr/sys/ken/slp.c
# wakeup usr/sys/ken/slp.c
The limits are as specific as the strengths. The commentary covers one kernel on one architecture in one dialect of C. The famous aretu construction broke when the machine changed. Later Unix added paging, networking, and a different process model, none of which Lions addresses. Read it as a complete worked example of a small system and it holds up. Read it as a description of how a modern kernel works and it will mislead you.
This is why the book still gets recommended to developers who want to understand scheduling, buffering, and file systems from inside rather than from a diagram. A 29 KB kernel is bootable in a PDP-11 simulator like SIMH and small enough to finish. No current kernel offers that.
The architectural lessons from this episode echo through real-world challenges in software architecture evolution every day. Shopify’s modular monolith and Discord’s ScyllaDB migration are the modern versions of the same problem: understanding why systems work the way they do requires reading the actual code, and reading the actual code requires documentation that explains it.
The Real Lesson: Explainers Beat Code
The KongchangAI retrospective on this history extends the lesson to modern practice: what is often scarce is not the code itself, but the people who can explain the code clearly. Lions’ value lies in the annotations, not just the source code.
That’s worth sitting with for a minute. The most famous piece of computer science education material from the 1970s isn’t a textbook. It isn’t a paper. It’s a set of lecture notes that a professor wrote because he couldn’t find anything good enough to teach his students. The legal system tried to suppress it. The market tried to price it out of existence. Neither worked, because the underlying need was too strong.
Peter Reintjes called what they acquired “literary criticism of computer software.” That’s still the rarest and most valuable form of technical writing. It’s why serious engineers still read Lions’ commentary. It’s why unintended consequences of security-focused architectural decisions keep happening, because someone locks down a system without understanding how it works.
The lesson for modern architecture teams is uncomfortable: your documentation strategy is an architectural decision, not a writing task. The best documentation explains not just what the code does, but why the architecture is the way it is. The best documentation reads like literary criticism, not like a reference manual.
The Underground Kingdom of Knowledge
There’s a darker lesson here too, one that applies to architectural fragility in large-scale systems and risks of poor architectural isolation in multi-tenant systems. The systems that survive are the ones that can be understood. The systems that fail are often the ones where understanding became a privilege rather than a right.
AT&T’s licensing restrictions didn’t just fail to stop the spread of Unix knowledge. They actively created the conditions for a generation of engineers who learned kernel internals outside formal channels. The photocopy chain produced a cohort of developers who understood operating systems intimately, not despite the restrictions but because of them. The secrecy made the knowledge more valuable, and the underground network made it more shared.
That’s the independent architectural choices enabling system longevity lesson in its purest form. When you control the code but not the understanding, you’re not protecting your architecture. You’re just ensuring that when the explainers find a way around your restrictions, and they will, they’ll do it without you.
Ken Thompson’s verdict stands: after 20 years, it was still the best exposition of the workings of a real operating system. The book that couldn’t legally be published became the book that had to be read. The architecture that couldn’t be discussed became the architecture that shaped a generation.
The most interesting question for modern system builders isn’t whether your code will survive. It’s whether someone will write the commentary that keeps your architecture alive when you’re gone. If they can’t legally read it, they’ll find a way anyway. If they can’t understand it, they’ll build something better from scratch.
Choose which outcome you prefer.
