Operating Systems; Three Easy Pieces - review
Operating Systems: Three Easy Pieces - review
Some time ago I had some fun building (virtual) hardware and a compiler toolchain using the famous Nand To Tetris book. The fragments of the OS built in that book were interesting, but the book itself never went into too much of a detail, which for me was unfortunate. What was fortunate, on the other hand, was learning about the so called Operating Systems: Three Easy Pieces also known as OSTEP.
What’s in the box
Funny enough, the title itself is not entirely true. The book really has 4, or even 5 pieces, if you want to count appendices. But it’s the first 3 where the book shines.
First Piece: Virtualization
The first piece includes a thorough explanation of the CPU and the Memory virtualization. Using this technique, the OS can trick the process into thinking that it has all the machine resources to itself, which was true for example for the computer & OS built in the Nand2Tetris. I found the chapters included in this piece really engaging.
Piece Two: Concurrency
The second group of chapters focused on Threads, which enables us to have multiple points of execution - multiple stacks, PC registers and others within a process with a shared heap. Linux scheduler works in terms of tasks, which can be either a process or a thread. I liked this chapter too, albeit a little less than the previous one. I feel like it focused too much on handling the concurrency right in the user land, rather than how it is implemented in the OS. For the ultimate “getting concurrency right” book that covers classic concurrency approaches, I’d still recommend the old Java Concurrency in Practice by Brian Goetz, even if you don’t do any Java.
Piece Three: Persistence
The last of the easy pieces. As good as the first one, if not better. Only the RAID chapter drags on a little. I really like the description of all persistent data structures that form a file system and what it takes to make them consistent when talking about journaling.
Other pieces
As mentioned, there are a few more chapters which weren’t part of the original three pillars.
First of them - Security, a comprehensive, high-level overview of IT security from the perspective of the OS. Even if not part of the book’s core, I’d still regard this section as an integral part of the book. I liked the chapter about distributed system security. It contains a rare case of an SSL/TLS description that is deep enough so you can understand every piece of it, but at the same time it’s not going into too many details of a particular crypto algorithm.
Besides that, we have two appendices, about virtual machine monitors and object monitors concurrency mechanism (like in Java). They could have been part of piece one and piece two respectively, but for some reason, the authors decided against it.
General impressions
Overall, the book was fun, educational, and full of personality. It didn’t cover every aspect of the modern OS, but it was comprehensive enough, and it wasn’t a dry read.
It’s important to state that it’s not a project-based book. There are some exercises, but most of them had a form of Python script simulations to tinker with. The few coding exercises integrated into the book are rather small. There are some C projects in the labs section, at the end of the book. But it’s apparent that the book structure is more dedicated for a university professor to create a course around, rather than for a self-learner. I did some of the labs, but I wasn’t motivated enough to do all of them. Perhaps some other time.
Moreover, there wasn’t really much about network interfaces and programming, system booting, containers, UI environments…
Still, what was covered was great! I’d highly recommend it to anyone that wants to learn more about what’s inside the OS.