Product Details
Linux Kernel Development (2nd Edition)

Linux Kernel Development (2nd Edition)
By Robert Love

List Price: $54.99
Price: $37.11 & eligible for FREE Super Saver Shipping on orders over $25. Details

Availability: Usually ships in 24 hours
Ships from and sold by Amazon.com

41 new or used available from $19.99

Average customer review:

Product Description

The Linux kernel is one of the most important and far-reaching open-source projects. That is why Novell Press is excited to bring you the second edition of Linux Kernel Development, Robert Love's widely acclaimed insider's look at the Linux kernel. This authoritative, practical guide helps developers better understand the Linux kernel through updated coverage of all the major subsystems as well as new features associated with the Linux 2.6 kernel. You'll be able to take an in-depth look at Linux kernel from both a theoretical and an applied perspective as you cover a wide range of topics, including algorithms, system call interface, paging strategies and kernel synchronization. Get the top information right from the source in Linux Kernel Development.


Product Details

  • Amazon Sales Rank: #65699 in Books
  • Published on: 2005-01-22
  • Original language: English
  • Number of items: 1
  • Binding: Paperback
  • 432 pages

Features


Editorial Reviews

From the Back Cover

Linux Kernel Development details the design and implementation of the Linux kernel, presenting the content in a manner that is beneficial to those writing and developing kernel code. While the book discusses topics that are theoretical, it does so with the goal of assisting programmers so they better understand the topics and become more efficient and productive in their coding.

The book discusses the major subsystems and features of the Linux kernel, including design and implementation, their purpose and goals, and their interfaces. Important computer science and operating system design details are also addressed. The book covers the Linux kernel from both angles -- theoretical and applied -- which should appeal to both types of readers.

The author, a core kernel developer, shares valuable knowledge and experience on the very latest Linux kernel.

Specific topics covered will include: all the important algorithms, relevant subsystems, process management, scheduling, time management and timers, system call interface, memory addressing, memory management, paging strategies, caching layers, VFS, kernel synchronization, and signals.

An authoritative, practical guide that helps programmers better understand the Linux kernel, and to write and develop kernel code.


* Authored by core Linux kernel developers.
* In-depth coverage of all the major subsystems and features of the new Linux 2.6 kernel.
* Targeted audience includes programmers interested in gaining relevant and timely information so they may further their kernel development skills.

About the Author

Robert Love is an open source hacker who has used Linux since the early days. Robert is active in and passionate about both the Linux kernel and the GNOME communities. Robert currently works as Senior Kernel Engineer in the Ximian Desktop Group at Novell. Before that, he was a kernel engineer at MontaVista Software.

Robert's kernel projects include the preemptive kernel, the process scheduler, the kernel events layer, VM enhancements, and multiprocessing improvements. He is the author and maintainer of schedutils and GNOME Volume Manager.

Robert has given numerous talks on and has written multiple articles about the Linux kernel. He is a Contributing Editor for Linux Journal.

Robert received a B.A. in Mathematics and a B.S. in Computer Science from the University of Florida. Born in South Florida, Robert currently calls Cambridge, Massachusetts home. He enjoys college football, photography, and cooking.

Excerpt. © Reprinted by permission. All rights reserved.
Linux Kernel Development, Second Edition

Linux Kernel Development, Second Edition

Preface

When I was first approached about converting my experiences with the Linux kernel into a book, I proceeded with trepidation. I did not want to write simply yet another kernel book. Sure, there are not that many books on the subject, but I still wanted my approach to be somehow unique. What would place my book at the top of its subject? I was not motivated unless I could do something special, a best-in-class work.

I then realized that I could offer quite a unique approach to the topic. My job is hacking the kernel. My hobby is hacking the kernel. My love is hacking the kernel. Over the years, I have surely accumulated interesting anecdotes and important tips. With my experiences, I could write a book on how to hack the kernel and—more importantly—how not to hack the kernel. Primarily, this is a book about the design and implementation of the Linux kernel. The book's approach differs from would-be competition, however, in that the information is given with a slant to learning enough to actually get work done—and getting it done right. I am a pragmatic guy and this is a practical book. It should be fun, easy to read, and useful.

I hope that readers can walk away from this book with a better understanding of the rules (written and unwritten) of the kernel. I hope readers, fresh from reading this book and the kernel source code, can jump in and start writing useful, correct, clean kernel code. Of course, you can read this book just for fun, too.

That was the first edition. Time has passed, and now we return once more to the fray. This edition offers quite a bit over the first: intense polish and revision, updates, and many fresh sections and all new chapters. Changes in the kernel since the first edition have been recognized. More importantly, however, is the decision made by the Linux kernel community1 to not proceed with a 2.7 development kernel in the near feature. Instead, kernel developers plan to continue developing and stabilizing 2.6. This implies many things, but one big item of relevance to this book is that there is quite a bit of staying power in a recent book on the 2.6 Linux kernel. If things do not move too quickly, there is a greater chance of a captured snapshot of the kernel remaining relevant long into the future. A book can finally rise up and become the canonical documentation for the kernel. I hope that you are holding that book.

Anyhow, here it is. I hope you enjoy it.

So Here We Are

Developing code in the kernel does not require genius, magic, or a bushy Unix-hacker beard. The kernel, although having some interesting rules of its own, is not much different from any other large software endeavor. There is much to learn—as with any big project—but there is not too much about the kernel that is more sacred or confusing than anything else.

It is imperative that you utilize the source. The open availability of the source code for the Linux system is a rarity that we must not take for granted. It is not sufficient only to read the source, however. You need to dig in and change some code. Find a bug and fix it. Improve the drivers for your hardware. Find an itch and scratch it! Only when you write code will it all come together.

Kernel Version

This book is based on the 2.6 Linux kernel series. Specifically, it is up to date as of Linux kernel version 2.6.10. The kernel is a moving target and no book can hope to capture a dynamic beast in a timeless manner. Nonetheless, the basics and core internals of the kernel are mature and I work hard to present the material with an eye to the future and with as wide applicability as possible.

Audience

This book targets software developers who are interested in understanding the Linux kernel. It is not a line-by-line commentary of the kernel source. Nor is it a guide to developing drivers or a reference on the kernel API (as if there even were a formal kernel API—hah!). Instead, the goal of this book is to provide enough information on the design and implementation of the Linux kernel that a sufficiently accomplished programmer can begin developing code in the kernel. Kernel development can be fun and rewarding, and I want to introduce the reader to that world as readily as possible. This book, however, in discussing both theory and application, should appeal to readers of either interest. I have always been of the mind that one needs to understand the theory to understand the application, but I do not feel that this book leans too far in either direction. I hope that whatever your motivations for understanding the Linux kernel, this book will explain the design and implementation sufficiently for your needs.

Thus, this book covers both the usage of core kernel systems and their design and implementation. I think this is important, and deserves a moment's discussion. A good example is Chapter 7, "Bottom Halves and Deferring Work," which covers bottom halves. In that chapter, I discuss both the design and implementation of the kernel's bottom-half mechanisms (which a core kernel developer might find interesting) and how to actually use the exported interfaces to implement your own bottom half (which a device driver developer might find interesting). In fact, I believe both parties should find both discussions relevant. The core kernel developer, who certainly needs to understand the inner workings of the kernel, should have a good understanding of how the interfaces are actually used. At the same time, a device driver writer will benefit from a good understanding of the implementation behind the interface.

This is akin to learning some library's API versus studying the actual implementation of the library. At first glance, an application programmer needs only to understand the API—it is often taught to treat interfaces as a black box, in fact. Likewise, a library developer is concerned only with the library's design and implementation. I believe, however, both parties should invest time in learning the other half. An application programmer who better understands the underlying operating system can make much greater use of it. Similarly, the library developer should not grow out of touch with the reality and practicality of the applications that use the library. Consequently, I discuss both the design and usage of kernel subsystems, not only in hopes that this book will be useful to either party, but also in hopes that the whole book is useful to both parties.

I assume that the reader knows the C programming language and is familiar with Linux. Some experience with operating system design and related computer science concepts is beneficial, but I try to explain concepts as much as possible—if not, there are some excellent books on operating system design referenced in the bibliography.

This book is appropriate for an undergraduate course introducing operating system design as the applied text if an introductory book on theory accompanies it. It should fare well either in an advanced undergraduate course or in a graduate-level course without ancillary material. I encourage potential instructors to contact me; I am eager to help.

Book Website

I maintain a website at http://tech9.net/rml/kernel_book/ that contains information pertaining to the book, including errata, expanded and revised topics, and information on future printings and editions. I encourage readers to check it out. I also apologize profusely for the previous end-of-sentence preposition, it was uncalled for, but the revamped sentence was hard to read, it was confusing, and you deserve better.

Second Edition Acknowledgments

Like most authors, I did not write this book in a cave (which is a good thing, because there are bears in caves) and consequently many hearts and minds contributed to the completion of this manuscript. Although no list would be complete, it is my sincere pleasure to acknowledge the assistance of many friends and colleagues who provided encouragement, knowledge, and constructive criticism.

First off, I would like to thank all of the editors who worked long and hard to make this book better. I would particularly like to thank Scott Meyers, my acquisition editor, for spearheading this second edition from conception to final product. I had the wonderful pleasure of again working with George Nedeff, production editor, who kept everything in order. Extra special thanks to my copy editor, Margo Catts. We can all only hope that our command of the kernel is as good as her command of the written word.

A special thanks to my technical editors on this edition: Adam Belay, Martin Pool, and Chris Rivera. Their insight and corrections improved this book immeasurably. Despite their sterling efforts, however, any remaining mistakes are my own fault. The same big thanks to Zack Brown, whose awesome technical editing efforts on the first edition still resonate loudly.

Many fellow kernel developers answered questions, provided support, or simply wrote code interesting enough on which to write a book. They are Andrea Arcangeli, Alan Cox, Greg Kroah-Hartman, Daniel Phillips, Dave Miller, Patrick Mochel, Andrew Morton, Zwane Mwaikambo, Nick Piggin, and Linus Torvalds. Special thanks to the kernel cabal (there is no cabal).

Respect and love to Paul Amici, Scott Anderson, Mike Babbitt, Keith Barbag, Dave Camp, Dave Eggers, Richard Erickson, Nat Friedman, Dustin Hall, Joyce Hawkins, Miguel de Icaza, Jimmy Krehl, Patrick LeClair, Doris Love, Jonathan Love, Linda Love, Randy O'Dowd, Sal Ribaudo and mother, Chris Rivera, Joey Shaw, Jon Stewart, Jeremy VanDoren and family, Luis Vil...


Customer Reviews

Excellent Linux kernel development book for newbie and prof.5
I have been doing Linux kernel/system level development on and off since 1999. This is the book that I think should be owned by any Linux newbie who wants starting their kernel hacking. Even if people do not directly do Linux kernel development, it is a good book complementary to any serious operating systems course in college - it helps gain a better idea of how and why.

The book is quite easy to follow and read and does not try to overwhelm readers with tons of information (consequently it does not address many details in Linux kernel). I consider this is a major strength of the book which parts away from other books (comparing to "Understanding the Linux Kernel", which has quite some details on each subsystem, but if you take the book as your guide to kernel programming, you feel you are overwhelmed by the information and often clueless on where to start to write some simple stuffs. This does not mean I think the latter is a bad one - it is a very good one indeed). Considering the fact that Linux kernel evolves so fast, it may make sense to focus on the core parts and once you understand them, it may become easy for you to track and understand changes later. Even as a professional programmer doing kernel development, occasionally referencing a well-written book like this is very helpful.

I am a bit reluctant to rate it 5 stars though due to many typos observed, which I guess is the result of rush to publishing (and the poor job of proofreading). Fortuanately, most can be understood by reading the contexts around them. But a few are really misleading or totally wrong. For example, on page 169, there is a sample code to show how page allocation/free is done in kernel. It uses __get_free_pages() to allocate pages, but uses free_pages() to free these pages. As the author has just said a page ago, __free_pages() should be used to free (struct page*) pages, otherwise corruption will ensure (free_pages is used to free pages with logic address as parameter).

clear and careful explanations from an expert5
I was a Linux kernel newbie writing a device driver and started reading "Linux Device Drivers" by Rubini. On hindsight, this was a bad idea. Rubini's book goes deep into driver code quickly with good details but it only sparingly touches the higher level kernel overview or essential concepts. These missing pieces are covered very well in Love's book and I should have understood them before reading Rubini's book; important basic concepts covered in good detail include:

- user thread vs kernel thread.
- kernel-space process context vs kernel-space interrupt context.
- tasklet as a non-concurrent form of softirq and is not related in any way to tasks.
- bottom-half methods comprising softirq, tasklet and work queue; and that BH and task queue are obsolete and deprecated.
- semaphore sleeping vs spinlock spinning (busy-wait).
- spinlock adversely affecting scheduling latency while semaphore does not.

Love's book shows ambly that he is an expert in Linux kernel matters and speaks with authority. At the same time he has the ability of a good teacher to explain obscure and critical kernel concepts clearly. I heartily recommend this as the first book one should read about the Linux kernel, well before books such as Bovet's "Understanding the Linux Kernel" or Rubini's device driver book.

This 2nd edition introduces more materials and explanation to cover the updated 2.6 kernel. As far as I can see, it is a worthy new edition to own.

The best book to learn Linux kernel programming5
About one year ago I was browsing the univerity book store, not really knowing what I was looking for. Being all fed up with math thesis stuff I was certain that I wanted somthing practical and funny to read. By chance I saw a book called "Linux Kernel Development". At first I did not give it much attention because normaly writing kernel code does not make me relax at all. When I was leaving the book store, curiosity took over and I decided to find out who the author was - expecting to see some no name punk I was really surprised that it was Robert Love, known of much programming fame in the kernel community. Naturaly I bought the book, read it in 2 days and I loved it. Here for the first time was a book that precendet the art of kernel programming in an easy, understandebel and about all funny way. This was 2004, last week I discovered that a second edtion was out. I quickly bought it on Amazon and while I loved the first edition I must admit that this one is even better.

Robert takes you gently but thoroughly through most of the facets of kernel programming, including system call registration, coding guidelines, synchronization and the VM layer. This is a great book which while being short and precise still manages to get you hacking on the kernel without suffering two much headache. The only thing I feel is missing is a chapter or two devoted to debugging the kernel - but in that regard one could also pickup "Linux(R) Debugging and Performance Tuning " by Steve Best which is a complete book on the fine art of bug/bottleneck hunting. Anyway this is one of the best written tech book I have ever had the joy of reading and it fully deserves to be put next to computer science classics such as "Introduction to Algorithms" and "The C Programming Language".