Linux Device Drivers

Be forewarned, though; if you are not comfortable with C, you won't understand the examples that are amply spread throughout.
  • Author: Alessandro Rubini

  • Publisher: O'Reilly & Associates, Inc.

  • E-mail: info@ora.com

  • URL: http://www.ora.com/

  • Price: $29.95 US

  • ISBN: 1-56592-292-1

  • Reviewer: Mark Bishop

In the last few years, we have seen an explosion in the number of devices supported by Linux. If you ever want to know how device drivers work or add kernel support for a particular device, Linux Device Drivers is the book for you. Be forewarned, though; if you are not comfortable with C, you won't understand the examples that are amply spread throughout. Also note that no matter how good a Linux device driver book really is, it will become outdated simply due to the rate at which the Linux kernel is developed. Mr. Rubini is aware of this fact, and throughout the book, he generously notes the differences between kernel versions when applicable. He even goes so far as to devote an entire chapter to recent developments in the Linux kernel.

I found Linux Device Drivers to be very complete in its description of the Linux kernel versions for which it was written—2.0.x to 2.1.43, which were the most recent at the time of its initial printing.

This book is roughly divided into two parts. Part One includes chapters 1 through 10 and starts out with a simple “Hello World” module, then moves on to describe how kernel modules are properly set up. Part One continues through the entire gambit of modular device programming needed to write a full-featured driver for a character-oriented device.

Since the audience may not have any experience writing modular device drivers, a chapter on debugging techniques is included. I found these to be quite useful, and they helped me to accelerate the development of several kernel drivers I was writing. One thing I did find baffling is the order in which several chapters are presented. The one that stands out most is Chapter 10, which deals primarily with portability issues. This chapter could have been presented earlier in the book to help maintain the flow the author had sustained early on.

I found Chapter 9 to be the most useful and the most fun; it covers interrupt handling. To help facilitate the reader's understanding of how interrupts are processed and handled, it requires the reader to modify his parallel port by connecting two pins together. (The parts can be found at your local computer hardware store for about $3.) Once my parallel port was modified, I was able to make full use of the examples. Mr. Rubini takes a difficult subject and breaks it into manageable parts. He does this quite effectively, moving through very technical topics with great fluidity.

Part Two of Linux Device Drivers covers more advanced topics. These include block drivers and network interfaces, and how one would write device drivers specific to them. Part Two also covers memory management and device access on peripheral buses such as the PCI and ISA bus. It also delves deeper into topics briefly mentioned in Part One.

Also in Part Two is something I have rarely seen described in other Linux kernel books—a description of the actual physical layout of the kernel source. Mr. Rubini approaches this by following the path in which the kernel boots from the first architecture-independent function (start_kernel) through the init process. This is also one of those chapters which might have been better placed earlier in the book, but no matter where it's located, its inclusion is greatly appreciated.

Linux Device Drivers serves many different purposes. This book will always serve the developer who wants to expand the number of devices which work with Linux. Also, you need not have the desire to write a device driver to learn something from it. All you need is an interest in knowing more about how devices work with the kernel to provide the services and stability we want. It is a great piece of work, where the one major drawback is time—this book was published in February of 1998. Changes made in subsequent printings may be found at http://www.oreilly.com/catalog/linuxdrive/errata/. I urge Mr. Rubini to follow up with a second edition, and I plan to be first in line for my copy.

Mark Bishop (mark@bish.net) recently graduated from Southern Illinois University and moved to Tampa, Florida, where he now has a job in the engineering field. He is primarily interested in developing embedded applications. Whenever he can, he works on the MP3 player he designed for his Jeep.

______________________

Webcast
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers

Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions