This legendary underground classic, reproduced without modification, is really two works in one:
▪︎ the complete source code to an early version of the UNIX operating system; and ▪︎ a brilliant commentary on that code by John Lions
Dennis Ritchie, Ken Thompson, and other UNIX luminaries have contributed new essays on the enduring value of this Computer Science masterpiece.
Lions’ marriage of source code with commentary was originally used as an operating systems textbook, a purpose for which it remains well-suited. As a self-study UNIX conceptual tutorial, it has informed and inspired computer professionals and advanced operating system students for over twenty years.
I've never run across another book like it: take a collection of working kernel and boot code and write commentary on every function.
You'll start out learning PDP 11/40 assembly and PDP machine architecture, followed by how the system boots into /unix, and from there onto a full tour of Unix.
Unix 6th Edition was much smaller than any modern desktop Unix, it fit into 32K of RAM. Fewer features translates into much simpler to understand code. Most times, code is concise and readable although often function names are semi-cryptic and (sometimes in assembly) so be prepared to study, it pays off.
You can still run Unix 6th Edition today on a PDP simulator and I often found myself firing it up and reading through the source on the running system.
This was interesting. Also, this code is a lot closer to assembly than normal C, a lot of it is weirdly optimized, and there are things in it that make you cringe. Otherwise it's well written, very hard to understand at places, but with the commentary it becomes manageable.
At some point I felt like getting a pdp11 to try it on (probably an emulator).
Obviously not for the faint of heart, or anyone without at least some experience with C and pointer arithmetic, but still a really nice examination of what two smart guys can come up with when it's just them together in a room coding without a huge bureaucracy and team of people designing by committee. As one of the reviewers also said, it really demonstrates engineering tradeoffs very well - you need simplicity but you need reliability but you need it to be inexpensive and you'd really like it to be fast, etc. There's a lot of balance demonstrated in the code here. It's also a lot easier to see how computers work when they were a lot simpler, but all the important guts are there. Recommended for computer historians especially!
In short this book is worth reading if you want to gather programming mastery of Dennis and Ken. And if you think you know "C", you should definitely test yourself by reading this book, you'll see that "C" is different in the hand of its authors. Nevertheless, the book can sometimes be hard as it requires knowledge of the old hardware like PDP-11, which consumes time. So if you want to just learn about internals easily without reading source code, you'll better go with "Unix internals" or other descriptive book.
Also, from today's perspective some algorithms used in UnixV6 may look naive, but I want to note that they did great job for that scale and they're easy to grasp because of their simplicity; the *simplicity* which helped Unix win over Multics like complex operating systems.