Linux Kernel Development, 2nd Edition
- By Robert Love
- Published Jan 12, 2005 by Novell Press. Part of the Novell Press series.
- Copyright 2005
- Dimensions: Special (all other)
- Pages: 432
- Edition: 2nd
- ISBN-10: 0-672-32720-1
- ISBN-13: 978-0-672-32720-9
- eBook (Watermarked)
- ISBN-10: 0-7686-6601-5
- ISBN-13: 978-0-7686-6601-4
Register your product to gain access to bonus material or receive a coupon.
Product Author Bios
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.
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.
18 of 18 people found the following review helpful
The best book to learn Linux kernel programming,
Amazon Verified Purchase(What's this?)
This review is from: Linux Kernel Development (2nd Edition) (Paperback)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... Read more
13 of 13 people found the following review helpful
Great description of the Linux Kernel,
This review is from: Linux Kernel Development (2nd Edition) (Paperback)Everybody should introduce their background before reviewing, since that helps a lot when other people read your opinion. In my case I'm an EE, and never took a course in OS or have a lot of experience in OS design or the like. My work has been in low level design of embedded systems, including HW and SW. We'll be porting the Linux Kernel to our own HW architecture, and bought this book as a reference to understand what to touch.
Now on to the book: I think it's great. I haven't got to the point where we touched actual code though. I've read the book and got a great idea of how Linux handles all the tasks an OS should. It also helped me understand a lot about OS design in general, without being a beginner's book (you know, those that have just the basic stuff that you can't do anything with).
I believe the idea behind the book is to teach you the philosophy behind the OS, with samples of the algorithms and C cde, and then point you in the right direction (where... Read more
12 of 12 people found the following review helpful
One of the Best Linux Book,
Amazon Verified Purchase(What's this?)
This review is from: Linux Kernel Development (2nd Edition) (Paperback)I just got my order (the 2nd edition) yesterday. This is my second book about Linux Kernel, the other one is "Understanding The Linux Kernel" by Daniel P. Bovet, Marco Cesati. I was having hard time to understand reading the Bovet's book, but when I read this book it was really fun. I even couldn't stop reading it when the time past midnight (wow, it is like reading a thrilling novel book :-).
I love the way the author tries to explain in a "human plaintext" language (w/ some humors), and gradually he introduces some jargons w/ clear explanations. The book is intended for intermediate to advanced programmers who now C and have some experience in building their kernel from source code. Although, it still guides readers how to compile, to patch and so on (chapter 2).
Another good thing is that, unlike many other Linux Kernel books, the author emphasizes concepts of the Linux Internals. So he tries to minimize a copy-paste of the source code on the book (you... Read more
› See all 29 customer reviews...
Online Sample Chapters
Table of Contents
1. Introduction to the Linux Kernel.
Along Came Linus: Introduction to Linux
Overview of Operating Systems and Kernels
Linux Versus Classic Unix Kernels
Linux Kernel Versions
The Linux Kernel Development Community
Before We Begin
2. Getting Started with the Kernel.
Obtaining the Kernel Source
Installing the Kernel Source
The Kernel Source Tree
Building the Kernel
Minimizing Build Noise
Spawning Multiple Build Jobs
Installing the Kernel
A Beast of a Different Nature
No Memory Protection
No (Easy) Use of Floating Point
Small, Fixed-Size Stack
Synchronization and Concurrency
Portability Is Important
So Here We Are
3. Process Management.
Process Descriptor and the Task Structure
Allocating the Process Descriptor
Storing the Process Descriptor
Manipulating the Current Process State
The Process Family Tree
The Linux Implementation of Threads
Removal of the Process Descriptor
The Dilemma of the Parentless Task
Process Wrap Up
4. Process Scheduling.
I/O-Bound Versus Processor-Bound Processes
The Scheduling Policy in Action
The Linux Scheduling Algorithm
The Priority Arrays
Calculating Priority and Timeslice
Sleeping and Waking Up
The Load Balancer
Preemption and Context Switching
Scheduler-Related System Calls
Scheduling Policy and Priority-Related System Calls
Processor Affinity System Calls
Yielding Processor Time
5. System Calls.
APIs, POSIX, and the C Library
System Call Numbers
System Call Performance
System Call Handler
Denoting the Correct System Call
System Call Implementation
Verifying the Parameters
System Call Context
Final Steps in Binding a System Call
Accessing the System Call from User-Space
Why Not to Implement a System Call
System Calls in Conclusion
6. Interrupts and Interrupt Handlers.
Top Halves Versus Bottom Halves
Registering an Interrupt Handler
Freeing an Interrupt Handler
Writing an Interrupt Handler
A Real-Life Interrupt Handler
Implementation of Interrupt Handling
Disabling and Enabling Interrupts
Disabling a Specific Interrupt Line
Status of the Interrupt System
Don’t Interrupt Me; We’re Almost Done!
7. Bottom Halves and Deferring Work.
Why Bottom Halves?
A World of Bottom Halves
Implementation of Softirqs
Implementation of Tasklets
The Old BH Mechanism
Implementation of Work Queues
Using Work Queues
The Old Task Queue Mechanism
Which Bottom Half Should I Use?
Locking Between the Bottom Halves
Disabling Bottom Halves
The Bottom of Bottom-Half Processing
8. Kernel Synchronization Introduction.
Critical Regions and Race Conditions
Why Do We Need Protection?
What Causes Concurrency, Anyway?
So, How Do I Know What Needs Protecting?
Contention and Scalability
Locking and Your Code
9. Kernel Synchronization Methods.
Atomic Integer Operations
Atomic Bitwise Operations
Other Spin Lock Methods
Spin Locks and Bottom Halves
Reader-Writer Spin Locks
Creating and Initializing Semaphores
Spin Locks Versus Semaphores
BKL: The Big Kernel Lock
Ordering and Barriers
10. Timers and Time Management.
Kernel Notion of Time
The Tick Rate: HZ
The Ideal HZ Value
Internal Representation of Jiffies
User-Space and HZ
Hardware Clocks and Timers
The Timer Interrupt Handler
The Time of Day
Timer Race Conditions
The Timer Implementation
Out of Time
11. Memory Management.
Getting Zeroed Pages
Design of the Slab Layer
Slab Allocator Interface
Statically Allocating on the Stack
Playing Fair on the Stack
High Memory Mappings
The New percpu Interface
Per-CPU Data at Compile-Time
Per-CPU Data at Runtime
Reasons for Using Per-CPU Data
Which Allocation Method Should I Use?
12. The Virtual Filesystem.
Common Filesystem Interface
Filesystem Abstraction Layer
VFS Objects and Their Data Structures
Other VFS Objects
The Superblock Object
The Inode Object
The Dentry Object
The Dentry Cache
The File Object
Data Structures Associated with Filesystems
Data Structures Associated with a Process
Filesystems in Linux
13. The Block I/O Layer.
Anatomy of a Block Device
Buffers and Buffer Heads
The bio structure
The Old Versus the New
The Job of an I/O Scheduler
The Linus Elevator
The Deadline I/O Scheduler
The Anticipatory I/O Scheduler
The Complete Fair Queuing I/O Scheduler
The Noop I/O Scheduler
I/O Scheduler Selection
14. The Process Address Space.
The Memory Descriptor
Allocating a Memory Descriptor
Destroying a Memory Descriptor
The mm_struct and Kernel Threads
Lists and Trees of Memory Areas
Memory Areas in Real Life
Manipulating Memory Areas
mmap() and do_mmap(): Creating an Address Interval
The mmap() System Call
munmap() and do_munmap(): Removing an Address Interval
The munmap() System Call
15. The Page Cache and Page Writeback.
The address_space Object
The Old Page Hash Table
The Buffer Cache
The pdflush Daemon
bdflush and kupdated
Congestion Avoidance: Why We Have Multiple Threads
To Make a Long Story Short
At Home in the Source Tree
Generating Module Dependencies
Managing Configuration Options
Wrapping Up Modules
17. kobjects and sysfs.
Managing and Manipulating kobjects
Adding and Removing kobjects from sysfs
Adding Files to sysfs
The Kernel Events Layer
kobjects and sysfs in a Nutshell
What You Need to Start
Bugs in the Kernel
The Robustness of printk()
The Log Buffer
syslogd and klogd
A Note About printk() and Kernel Hacking
Kernel Debugging Options
Asserting Bugs and Dumping Information
Magic SysRq Key
The Saga of a Kernel Debugger
Poking and Probing the System
Using UID as a Conditional
Using Condition Variables
Rate Limiting Your Debugging
Binary Searching to Find the Culprit Change
When All Else Fails: The Community
History of Portability in Linux
Word Size and Data Types
Explicitly Sized Types
Signedness of Chars
Avoiding Alignment Issues
Alignment of Nonstandard Types
History of Big- and Little-Endian
Byte Ordering in the Kernel
SMP, Kernel Preemption, and High Memory
Portability Is Fun
20. Patches, Hacking, and the Community.
Linux Coding Style
Using What Is Already Provided
No ifdefs in the Source
Fixing Code Up Ex Post Facto
Chain of Command
Submitting Bug Reports
Appendix A. Linked Lists.
Circular Linked Lists
Moving Through a Linked List
The Linux Kernel’s Implementation
The Linked-List Structure
Manipulating Linked Lists
Traversing Linked Lists
Appendix B. Kernel Random Number Generator.
Design and Implementation
The Dilemma of System Startup
Interfaces to Input Entropy
Interfaces to Output Entropy
Appendix C. Algorithmic Complexity.
Big Theta Notation
Putting It All Together
Perils of Time Complexity
Bibliography and Reading List.
Books on Operating System Design
Books on Unix Kernels
Books on Linux Kernels
Books on Other Kernels
Books on the Unix API
Books on the C Programming Language
0672327201errata.pdf (55 KB)
This product currently is not for sale.
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.