Over the years, this bestselling guide has helped countless programmers learn how to support computer peripherals under the Linux operating system, and how to develop new hardware under Linux. Now, with this third edition, it's even more helpful, covering all the significant changes to Version 2.6 of the Linux kernel. Includes full-featured examples that programmers can compile and run without special hardware.
-
Chapter 1 An Introduction to Device Drivers
-
The Role of the Device Driver
-
Splitting the Kernel
-
Classes of Devices and Modules
-
Security Issues
-
Version Numbering
-
License Terms
-
Joining the Kernel Development Community
-
Overview of the Book
-
-
Chapter 2 Building and Running Modules
-
Setting Up Your Test System
-
The Hello World Module
-
Kernel Modules Versus Applications
-
Compiling and Loading
-
The Kernel Symbol Table
-
Preliminaries
-
Initialization and Shutdown
-
Module Parameters
-
Doing It in User Space
-
Quick Reference
-
-
Chapter 3 Char Drivers
-
The Design of scull
-
Major and Minor Numbers
-
Some Important Data Structures
-
Char Device Registration
-
open and release
-
scull's Memory Usage
-
read and write
-
Playing with the New Devices
-
Quick Reference
-
-
Chapter 4 Debugging Techniques
-
Debugging Support in the Kernel
-
Debugging by Printing
-
Debugging by Querying
-
Debugging by Watching
-
Debugging System Faults
-
Debuggers and Related Tools
-
-
Chapter 5 Concurrency and Race Conditions
-
Pitfalls in scull
-
Concurrency and Its Management
-
Semaphores and Mutexes
-
Completions
-
Spinlocks
-
Locking Traps
-
Alternatives to Locking
-
Quick Reference
-
-
Chapter 6 Advanced Char Driver Operations
-
ioctl
-
Blocking I/O
-
poll and select
-
Asynchronous Notification
-
Seeking a Device
-
Access Control on a Device File
-
Quick Reference
-
-
Chapter 7 Time, Delays, and Deferred Work
-
Measuring Time Lapses
-
Knowing the Current Time
-
Delaying Execution
-
Kernel Timers
-
Tasklets
-
Workqueues
-
Quick Reference
-
-
Chapter 8 Allocating Memory
-
The Real Story of kmalloc
-
Lookaside Caches
-
get_free_page and Friends
-
vmalloc and Friends
-
Per-CPU Variables
-
Obtaining Large Buffers
-
Quick Reference
-
-
Chapter 9 Communicating with Hardware
-
I/O Ports and I/O Memory
-
Using I/O Ports
-
An I/O Port Example
-
Using I/O Memory
-
Quick Reference
-
-
Chapter 10 Interrupt Handling
-
Preparing the Parallel Port
-
Installing an Interrupt Handler
-
Implementing a Handler
-
Top and Bottom Halves
-
Interrupt Sharing
-
Interrupt-Driven I/O
-
Quick Reference
-
-
Chapter 11 Data Types in the Kernel
-
Use of Standard C Types
-
Assigning an Explicit Size to Data Items
-
Interface-Specific Types
-
Other Portability Issues
-
Linked Lists
-
Quick Reference
-
-
Chapter 12 PCI Drivers
-
The PCI Interface
-
A Look Back: ISA
-
PC/104 and PC/104+
-
Other PC Buses
-
SBus
-
NuBus
-
External Buses
-
Quick Reference
-
-
Chapter 13 USB Drivers
-
USB Device Basics
-
USB and Sysfs
-
USB Urbs
-
Writing a USB Driver
-
USB Transfers Without Urbs
-
Quick Reference
-
-
Chapter 14 The Linux Device Model
-
Kobjects, Ksets, and Subsystems
-
Low-Level Sysfs Operations
-
Hotplug Event Generation
-
Buses, Devices, and Drivers
-
Classes
-
Putting It All Together
-
Hotplug
-
Dealing with Firmware
-
Quick Reference
-
-
Chapter 15 Memory Mapping and DMA
-
Memory Management in Linux
-
The mmap Device Operation
-
Performing Direct I/O
-
Direct Memory Access
-
Quick Reference
-
-
Chapter 16 Block Drivers
-
Registration
-
The Block Device Operations
-
Request Processing
-
Some Other Details
-
Quick Reference
-
-
Chapter 17 Network Drivers
-
How snull Is Designed
-
Connecting to the Kernel
-
The net_device Structure in Detail
-
Opening and Closing
-
Packet Transmission
-
Packet Reception
-
The Interrupt Handler
-
Receive Interrupt Mitigation
-
Changes in Link State
-
The Socket Buffers
-
MAC Address Resolution
-
Custom ioctl Commands
-
Statistical Information
-
Multicast
-
A Few Other Details
-
Quick Reference
-
-
Chapter 18 TTY Drivers
-
A Small TTY Driver
-
tty_driver Function Pointers
-
TTY Line Settings
-
ioctls
-
proc and sysfs Handling of TTY Devices
-
The tty_driver Structure in Detail
-
The tty_operations Structure in Detail
-
The tty_struct Structure in Detail
-
Quick Reference
-
-
Chapter 19 Bibliography
-
Books
-
Web Sites
-
- Title:
- Linux Device Drivers, Third Edition
- By:
- Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- February 2005
- Ebook Release:
- February 2009
- Pages:
- 640
- Print ISBN:
- 978-0-596-00590-0
- | ISBN 10:
- 0-596-00590-3
- Ebook ISBN:
- 978-0-596-15974-0
- | ISBN 10:
- 0-596-15974-9
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The image on the cover of Linux Device Drivers, Third Edition is a bucking bronco. A colorful description of this animal appears in Marvels of the New West: A Vivid Portrayal of the Stupendous Marvels in the Vast Wonderland West of the Missouri River, by William Thayer (The Henry Bill Publishing Co., Norwich, CT, 1888). Thayer quotes a stockman, who gives this description of a bucking horse: "When a horse bucks he puts his head down between his legs, arches his back like an angry cat, and springs into the air with all his legs at once, coming down again with a frightful jar, and he sometimes keeps on repeating the performance until he is completely worn out with the excursion. The rider is apt to feel rather worn out too by that time, if he has kept his seat, which is not a very easy matter, especially if the horse is a real scientific bucker, and puts a kind of side action into every jump. The double girth commonly attached to these Mexican saddles is useful for keeping the saddle in its place during one of those bouts, but there is no doubt that they frequently make a horse buck who would not do so with a single girth. With some animals you can never draw up the flank girth without setting them bucking." Matt Hutchinson was the production editor for Linux Device Drivers, Third Edition. Octal Publishing, Inc. provided production services. Genevieve d'Entremont, Sanders Kleinfeld, and Claire Cloutier provided quality control.
Edie Freedman designed the cover of this book, based on a series design by herself and Hanna Dyer. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with Adobe InDesign CS using Adobe's ITC Garamond font.
Melanie Wang designed the interior layout, based on a series design by David Futato. The chapter opening images are from the Dover Pictorial Archive, Marvels of the New West, and The Pioneer History of America: A Popular Account of the Heroes and Adventures, by Augustus Lynch Mason, A.M. (The Jones Brothers Publishing Company, 1884). This book was converted by Julie Hawks to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano, Jessamyn Read, and Lesley Borash using Macromedia FreeHand MX and Adobe Photoshop CS. The tip and warning icons were drawn by Christopher Bing.
