The Linux phenomenon gets bigger by the day and more developers are drawn into developing for it. The heart of this very phenonmenon is its kernel and as time goes by it becomes more mature but also bigger and more complex. New developers would have trouble diving in and code for it, hence the “Linux Kernel Development” book by well known kernel hacker Robert Love (of preemptive-patch fame).The book is published by Sams Publishing and it is a bit over 300 pages. The book starts off smoothly, with the introduction of Linux, its history, its difference from other Unix kernels, and a simplified diagram of its architecture and how to compile it.
From that point on, the book dives in immediately to more advanced topics, like process management, scheduling (explaining real time policies, preemption, context switching etc), system calls. Interrupt handlers, kernel synchronization, time and memory management kicks in afterwards and just as you thought things wouldn’t get more complex, the kernel’s VFS, I/O, paging, caching, and the prorcess address space comes right after.
The last few chapters are easier to follow as they discuss general policies in the development of the kernel, e.g. coding style, debugging techniques, portability, patches etc.
Each chapter starts with an explanation of what it is going to discuss (e.g. the scheduler), it gives general information on the topic (so the reader understands the role of the topic on any kernel) and then explains in more detail how the specific Linux topic is implemented, discusses its goals, design and architecture and when relevant, gives some info on their APIs and how they can be used. Some source code is used, but it is not really much (it is easily digested) as most of the book is actually theory.
I like the writing style of the author a lot – it is sincere, clear, to the point and with a twist of humor from time to time (“BKL is evil”). Additionally, this book is very up to date, as it discusses Linux kernel 2.6 more than anything else, and so developers who want to jump in and help out the greater cause, will find this book, the book to have. I believe that the greatest feature this book has to be that it is sincere in what the kernel does well and what it doesn’t. Potential kernel developers then could have a clear goal as to what to hack next and further improve.
However, the book doesn’t come without some limitations. I was very interested to read more about Symmetric MultiProcessing (SMP), but the book doesn’t go as deep as I wanted into the subject (however lots of SMP info is still included). The main drawback in my opinion is that it does not include information about driver writing. Granted, the author makes it clear up front that this book is not about writing drivers, however most drivers are part of the Linux kernel and by not including at least one chapter on them is a kind of a bummer. Next revision maybe…
This book is not really intended for new programmers or non-programmers. While it starts off easy, it becomes pretty complex along the way (which is normal as kernel development is complex), and so it would require some system software experience to completely follow through. However, if you like the challenge, or if you need to know more about the Linux kernel in general for any reason, this is definately the book to get. It would certainly be one of your best reads on operating systems topics.
Buy “Linux Kernel Development“
at Amazon.com for less
Foreword, by Andrew Morton
Chapter 01: Introduction
Chapter 02: Process Management
Chapter 03: Scheduling
Chapter 04: System Calls
Chapter 05: Interrupts and Interrupt Handlers
Chapter 06: Bottom Halves and Deferring Work
Chapter 07: Kernel Synchronization Introduction
Chapter 08: Kernel Synchronization Methods
Chapter 09: Timers and Time Management
Chapter 10: Memory Management
Chapter 11: The Virtual Filesystem
Chapter 12: The Block I/O Layer
Chapter 13: The Process Address Space
Chapter 14: The Page Cache and Page Writeback
Chapter 15: Debugging
Chapter 16: Portability
Chapter 17: Patches, Hacking, and the Community
Appendix A: Linked Lists
Appendix B: The Per-CPU Interface
Appendix C: Kernel Random Number Generator
Appendix D: Algorithmic Complexity
looks like a good read
It is indeed an excellent read. This book is my first exposure to kernel development, therefore, I did have to re-read several chapters a few times. One of the the things that made this book special to me is the fact that its based on the latest series of the kernel as opposed to the 2.4 series which most kernel books are based on. I highly suggest this book to anyone that wants to get into kernel development.
Doesn’t seem to be much judging from the contents. But I suspect that that is whole ‘nother book.
So far the 80 pages of the book I’ve read have been well written. I read the book with thought, and it was surprisingly easy to grasp the message. IMO, Linux Device Drivers book (see O’reilly) is not written as well, though it’s a good read too. I would recommend this book for everyone interested in kernel mechanisms, not just people into Linux.
i bought it (online is cheaper than most real shops) – and its very nice… very clear and very easy to digest… a gentle slide into the more diffilcult areas….
i would have liked more illustrative source code perhaps as a CDROM or at the end of the chapters or appendizx… i would have really loved a chepter on writing modules and drivers… modules and drivers which touch different parts of teh kernel… not just the sdtandard “netfilter hook”.
but a good book – and the best i currentrlty have on the kernel. also teh 4.4BSD design of book by mcKusick is excellent.
What is a good book/tutorial for writing drivers/modules for Linux?
Here it is, it is free and online:
Unfortunately, that book is from 2001 though, this is why I also wanted Robert’s book to feature some info about driver writing for the 2.6 kernel.
For device driver in 2.6, probably this one is what you really want:
and it is free.
Thanks guys. BTW, Eugenia, thank you for all your journalism. I’m a regular here and I always enjoy your level-headed reviews and comments.
i loved this book and thought it was amazing. i definitely recommend it.