Linux Core Kernel Commentary
What's to Like? Most interesting for me was the "a-ha!" factor. The normal chapter flow describes the subsection in general terms (memory management is designed to do such and such, with these issues), moves to the important data structure, and then walks through the vital functions for that section, stopping here and there to explain peculiarities and subtleties of the code. There's rough going in a few spots, but there are occasional moments of insight where the solutions come in to clear focus. (This happened most often for me in the SMP chapter, as the discussion of locks is particularly good.)
Maxwell manages to avoid unexplained jargon for the most part, though he invents names for implied kernel idioms. Even while dealing with highly specific topics, readers won't need a background in OS design to understand the text. Good C skills will help, as well as assembly, though the latter is explained in greater detail than the former.
The author also takes pains to point out flaws and possible optimizations in the kernel, though he often concludes that the route taken is the best for various reasons. Another theme is the tradeoffs necessary between speed, clarity, compatibility and portability. Finally, as kernel 2.4 will be out shortly, Appendix B discusses the modifications in the 2.3 tree as it went to press.
What's to Consider? As space is limited, Maxwell sometimes skips some interesting details -- especially in latter chapters. Unfortunately, phrases like "There's not room to cover this" or "that is out of the scope of this book" pop up now and then. I definitely wanted more.Two other small nitpicks may be corrected in a future version. First, it would have been nice if the current filename was listed on each page of the source code listing, just for reference. Second, flipping back and forth between commentary and code was tricky, especially in a book of this size. Perhaps splitting things into two books would help? Serious students might find it easier to browse the code from the CD-ROM, which includes the code for kernel versions 0.01, 2.2.5, 2.2.10, 2.3.12, and the entire code of the first section, numbered as it appears.
The Summary This could serve as a textbook in an OS design class. Supplemental material will be necessary (file systems not covered for example, nor are drivers). Perhaps paired with a more theoretical text, it could form the basis of an intermediate computer science class.The utility is not limited to students, though. Anyone wondering where to start understanding the Linux kernel would do well to consider this book.
Buy this book at ThinkGeek.
Table of Contents- Linux Core Kernel Code
- Linux Core Kernel Commentary
- Introduction to Linux
- A First Look at the Code
- Kernel Architecture Overview
- System Initialization
- System Calls
- Signals, Interrupts, and Time
- Processes and Threads
- Memory
- System V IPC
- Symmetric Multiprocessing (SMP)
- Tunable Kernel Parameters
- Appendices
- Linux 2.4
- GNU General Public License
...except for the shipping charges. I agree that the 37k lines of source may be a waste of trees, but it is easier to flip through a book sometimes.
A good companion to this book is Advanced Programming in the Unix Environment. I found myself wondering exactly why some kernel routines were implemented the way they were, until I read up on them in APUE. It's important to understand the "user" interface to the kernel when you're reading this book.
Knowledge of stuff like assembly language (GNU's version of course) and low-level stuff like IRQs/interrupts, memory segmentation, and device IO is important--like the review says, he doesn't go into those details. Higher-level stuff like scheduling, file-system calls, and IPC is dealt with very well.
OTOH, if you're not familiar with how operating systems work, I think you'd do better to start with John Lions's Lions' Commentary on Unix: With Source Code, (Peer to Peer Communications 1996), ISBN 1573980137.
This book, usually called "The Lions Book," has the full source code for an early version of Unix, followed by Professor Lions's annotations. The source and commentary are comparatively short (about 300 pages, compared to 400 pages for the Linux source alone), largely because the kernel it describes is a good deal smaller than the current linux kernel. This means it's also a lot simpler than the linux kernel.
If you're already comfortable with reading complex sources, and you know a lot about operating systems, then give Maxwell's book a try. But I suspect a lot of people would be overwhelmed by it, and the Lions Book is a better place for them to start.