Ask HN: What Comes After John Lions' Unix Commentary?
Any suggestions from the group here what is a good follow up to the classic John Lions’ commentary on Unix? Do I spring into the tanenbaum books on OS design? Looking for opinions. Feel free to ramble. Thank you!
10 comments
[ 3.1 ms ] story [ 43.1 ms ] threadFor a hands-on view on building operating systems, I can recommend taking a look at xv6 [1] as the next step. This is a modern reimplementation of a subset of the 6th edition Unix, running on RISC-V in its current version (an older version targeted x86) [2].
The classical textbooks used in OS courses (Tanenbaum's "Modern Operating Systems", Silberschatz' "Operating System Concepts" and Stallings' "Operating Systems") are more on the theoretical side, whereas Tanenbaum's Minix books are more hands-on. A current, somewhat more hands-on, textbook is "Operating Systems: Three Easy Pieces" by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau. Additional bonus - it's free [3].
For more hands-on resources, there's a lot of material available. osdev.org [4] provides lots of OS development knowledge in wiki form, Stephen Marz' "The Adventures of OS: Making a RISC-V Operating System using Rust" [5] is a hands-on course written as a series of blog posts to build your own OS for RISC-V (but it needs to be updated since RISC-V has changed in some details since the articles were published). I learned about OS theory and practice using Doug Comer's Xinu books [17] and I still think these are very useful.
You can then dig into older Unix(-like) systems, e.g. BSD [6,7] and/or check out more modern approaches such as Microkernels (I can especially recommend L4, starting from Jochen Liedtke's papers [8] and checking out work on seL4 [9]), capability-based systems (CHERI [10] and an old, but good overview book on capability architectures [11]), or - for something a bit more exotic - Plan 9 [12].
If you want to gain an insight into commercial operating systems, there are a number of interesting books on Apple's OS X and iOS [13,14], Windows [15] and even VMS [16].
I’ve flipped through Windows Internals years ago to find out how their multi-level scheduler works.
I’m interesting in putting together an OS for fun. Don’t even care to blog about it. I have experience with assembly and embedded systems with relatively little to no OS overhead, mostly 8-bit. Reverse engineering isn’t that bad either. Data sheets of processors don’t frighten me, usually. I hook their pins up to oscilloscopes and watch the lines go. I’m looking for an engaging, hands on book written by a competent systems engineer that is paced for programming. Tanenbaum/Minix 3 looks promising. Is this a ground up book with assignments or does he hand you a ready-made OS?
The Minix book explains details of Minix 3 (file system, memory management etc.) and gives a listing of the Minix kernel, but does not really explain how to write a system from scratch.
Comer's Xinu book is much better suited for this, it uses sort of a literate programming approach mixing code pieces and the related descriptions. However, Comer's books are rather old by now and the most modern architecture covered is MIPS.
If you want to start from the ground up, i.e. setting up a (cross-)compiler toolchain, building a kernel that boots with your bootloader of choice, starting with "Hello world" and then proceeding to syscalls, interrupt handling, cooperative and preemptive multitasking, virtual memory, etc., then Stephen Marz' blog is a better resource.
You could also check out the lecture slides for my operating systems engineering course if you're interested. In this (master level) course, we build a small preemptive multitasking OS with virtual memory for RISC-V from scratch in C: https://multicores.org/ose/
I definitely don’t mind RISC stuff, my embedded knowledge is somewhere between ARM and z80 offshoots. I started looking at Minix 3 book (I bought it and forgot I bought it many years ago, it seems) and am reading the source nodding and noodling along. Got caught up reading the interrupt controller data sheet. I remember seeing university courses using Minix as a foundation for building more things on top of it or replacing the default implementation of a piece with something else. Not sure if I can find any of those curriculums and assignments! I’ll have to play around with it. Im not looking for cutting edge data structures, just the general ensemble of putting together a kernel, various management pieces, and some sort of shell.
Very similar approach to Lions. There's a second volume that covers the networking stack as well.