Buying Options
Linux Device Drivers, Second Edition
This product is no longer available.

Please consider the latest edition.

Product Editions

  1. Linux Device Drivers, Third Edition - February 2005
  2. Linux Device Drivers, Second Edition - June 2001 (out of print)
  3. Linux Device Drivers - February 1998 (out of print)
Description
This practical guide is for anyone who wants to support computer peripherals under the Linux operating system. It shows step-by-step how to write a driver for character devices, block devices, and network interfaces, illustrating with examples you can compile and run. The second edition covers Kernel 2.4 and adds discussions of symmetric multiprocessing (SMP), Universal Serial Bus (USB), and some new platforms.
Full Description
Table of Contents
  1. Chapter 1 An Introduction to Device Drivers

    1. The Role of the Device Driver

    2. Splitting the Kernel

    3. Classes of Devices and Modules

    4. Security Issues

    5. Version Numbering

    6. License Terms

    7. Joining the Kernel Development Community

    8. Overview of the Book

  2. Chapter 2 Building and Running Modules

    1. Kernel Modules Versus Applications

    2. Compiling and Loading

    3. The Kernel Symbol Table

    4. Initialization and Shutdown

    5. Using Resources

    6. Automatic and Manual Configuration

    7. Doing It in User Space

    8. Backward Compatibility

    9. Quick Reference

  3. Chapter 3 Char Drivers

    1. The Design of scull

    2. Major and Minor Numbers

    3. File Operations

    4. The file Structure

    5. open and release

    6. scull's Memory Usage

    7. A Brief Introduction to Race Conditions

    8. read and write

    9. Playing with the New Devices

    10. The Device Filesystem

    11. Backward Compatibility

    12. Quick Reference

  4. Chapter 4 Debugging Techniques

    1. Debugging by Printing

    2. Debugging by Querying

    3. Debugging by Watching

    4. Debugging System Faults

    5. Debuggers and Related Tools

  5. Chapter 5 Enhanced Char Driver Operations

    1. ioctl

    2. Blocking I/O

    3. poll and select

    4. Asynchronous Notification

    5. Seeking a Device

    6. Access Control on a Device File

    7. Backward Compatibility

    8. Quick Reference

  6. Chapter 6 Flow of Time

    1. Time Intervals in the Kernel

    2. Knowing the Current Time

    3. Delaying Execution

    4. Task Queues

    5. Kernel Timers

    6. Backward Compatibility

    7. Quick Reference

  7. Chapter 7 Getting Hold of Memory

    1. The Real Story of kmalloc

    2. Lookaside Caches

    3. get_free_page and Friends

    4. vmalloc and Friends

    5. Boot-Time Allocation

    6. Backward Compatibility

    7. Quick Reference

  8. Chapter 8 Hardware Management

    1. I/O Ports and I/O Memory

    2. Using I/O Ports

    3. Using Digital I/O Ports

    4. Using I/O Memory

    5. Backward Compatibility

    6. Quick Reference

  9. Chapter 9 Interrupt Handling

    1. Overall Control of Interrupts

    2. Preparing the Parallel Port

    3. Installing an Interrupt Handler

    4. Implementing a Handler

    5. Tasklets and Bottom-Half Processing

    6. Interrupt Sharing

    7. Interrupt-Driven I/O

    8. Race Conditions

    9. Backward Compatibility

    10. Quick Reference

  10. Chapter 10 Judicious Use of Data Types

    1. Use of Standard C Types

    2. Assigning an Explicit Size to Data Items

    3. Interface-Specific Types

    4. Other Portability Issues

    5. Linked Lists

    6. Quick Reference

  11. Chapter 11 kmod and Advanced Modularization

    1. Loading Modules on Demand

    2. Intermodule Communication

    3. Version Control in Modules

    4. Backward Compatibility

    5. Quick Reference

  12. Chapter 12 Loading Block Drivers

    1. Registering the Driver

    2. The Header File blk.h

    3. Handling Requests: A Simple Introduction

    4. Handling Requests: The Detailed View

    5. How Mounting and Unmounting Works

    6. The ioctl Method

    7. Removable Devices

    8. Partitionable Devices

    9. Interrupt-Driven Block Drivers

    10. Backward Compatibility

    11. Quick Reference

  13. Chapter 13 mmap and DMA

    1. Memory Management in Linux

    2. The mmap Device Operation

    3. The kiobuf Interface

    4. Direct Memory Access and Bus Mastering

    5. Backward Compatibility

    6. Quick Reference

  14. Chapter 14 Network Drivers

    1. How snull Is Designed

    2. Connecting to the Kernel

    3. The net_device Structure in Detail

    4. Opening and Closing

    5. Packet Transmission

    6. Packet Reception

    7. The Interrupt Handler

    8. Changes in Link State

    9. The Socket Buffers

    10. MAC Address Resolution

    11. Custom ioctl Commands

    12. Statistical Information

    13. Multicasting

    14. Backward Compatibility

    15. Quick Reference

  15. Chapter 15 Overview of Peripheral Buses

    1. The PCI Interface

    2. A Look Back: ISA

    3. PC/104 and PC/104+

    4. Other PC Buses

    5. SBus

    6. NuBus

    7. External Buses

    8. Backward Compatibility

    9. Quick Reference

  16. Chapter 16 Physical Layout of the Kernel Source

    1. Booting the Kernel

    2. Before Booting

    3. The init Process

    4. The kernel Directory

    5. The fs Directory

    6. The mm Directory

    7. The net directory

    8. ipc and lib

    9. include and arch

    10. Drivers

  1. Bibliography

  2. Colophon

View Full Table of Contents
Product Details
Title:
Linux Device Drivers, Second Edition
By:
Jonathan Corbet, Alessandro Rubini
Publisher:
O'Reilly Media
Formats:
  • Print
Print Release:
June 2001
Pages:
592
Print ISBN:
978-0-596-00008-0
| ISBN 10:
0-596-00008-1
Customer Reviews
About the Authors
  1. Jonathan Corbet

    Jonathan Corbet got his first look at the BSD Unix source back in 1981, when an instructor at the University of Colorado let him "fix" the paging algorithm. He has been digging around inside every system he could get his hands on ever since, working on drivers for VAX, Sun, Ardent, and x86 systems on the way. He got his first Linux system in 1993, and has never looked back. Mr. Corbet is the co-founder and executive editor of Linux Weekly News; he lives in Boulder, Colorado with his wife and two children.

    View Jonathan Corbet's full profile page.

  2. Alessandro Rubini

    Alessandro Rubini installed Linux 0.99.14 soon after getting his degree as an electronic engineer. He then received a Ph.D in computer science at the University of Pavia despite his aversion toward modern technology. Alas, he still enjoys digging in technology and discovering the intelligence of people who created it: that's why he now works in his apartment with three PCs, an Alpha, a SPARC, and an Apple2 -- the last without Linux. But you might find him roaming around in the north of Italy on his bike, which doesn't carry an electronic cyclometer.

    View Alessandro Rubini's full profile page.

Colophon

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 is of a bucking horse. A colorful description of this 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." Darren Kelly was the production editor, Cynthia Kogut was the copyeditor, and Susan Carlson Greene was the proofreader for Linux Device Drivers, Second Edition . Catherine Morris and Claire Cloutier provided quality control. Judy Hoer wrote the index. Matt Hutchinson, Lucy Muellner, and Joe Wizda provided production support.

Edie Freedman designed the cover of this book. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1, using Adobe's ITC Garamond font.

David Futato designed the interior layout based on a series design by Nancy Priest. Chapter opener images are taken from the Dover Pictorial Archive, the book Marvels of the New West: A Vivid Portrayal of the Stupendous Marvels in the Vast Wonderland West of the Missouri River (by William M. Thayer, The Henry Bill Publishing Company, Norwich, CT, 1888), 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, Cincinnati, OH, 1884). The print version of this book was created by translating the DocBook XML markup of its source files into a set of gtroff macros, using a filter developed at O'Reilly & Associates by Norman Walsh. Steve Talbott designed and wrote the underlying macro set on the basis of the GNU troff –gs macros; Lenny Muellner adapted them to XML and implemented the book design. The GNU groff text formatter version 1.11.1 was used to generate PostScript output. The text and heading fonts are ITC Garamond Light and Garamond Book. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6.

  • Book cover of Linux Device Drivers