Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Linux Resources > LinuxForums.org - Articles
Reload this Page Linux Device Drivers -- 3rd Edition
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

LinuxForums.org - Articles Linux Forums Articles Archive.

 
 
Thread Tools Display Modes
Old 08-09-2005   #1 (permalink)
lakerdonald
Linux Guru
 
lakerdonald's Avatar
 
Join Date: Jun 2004
Location: St. Petersburg, FL
Posts: 5,039
Linux Device Drivers -- 3rd Edition

Linux Device Drivers -- 3rd Edition

Jonathan Corbet, Alessandro Rubini, & Greg Kroah-Hartman
(c)2005 O'REILLY Media, Inc.
MSRP: 39.95 USD
Overall Rating:

Touted as the definitive guide to writing device drivers for the Linux kernel, I went into LDD with high expectations. Granted, this book had a lot to live up to, but I was somewhat disappointed; the content was definitely on par, but it lacked that refinement found in most books O'Reilly publishes. There were several blatant typographical errors, and the book was literred with cross-references to non-existant sections in Chapter One. And just as a note, having the Documentation/ directory of the kernel sources open in a terminal would be handy, as the reader is often sent there for further information.

The book is laid out in a rather logical manner; new terms are defined as they become necessary, and each chapter deals with a different area of writing device drivers. The book starts off with a brief explanation of device drivers in general, how the kernel is made up, licensing issues, and some changes in the 2.6 Kernel. Then, Linux Device Drivers goes on to explain how to build a module (including a sample 'Hello World' module) and run it. Then the reader is introduced to 'char drivers', debugging issues, timers, memory allocation, and other more specific (and often advanced) topics.

Perhaps this stems from the mere fact that this book has three authors, but the book has some continuity and flow issues. This is evident as early as the 'Hello World' module in Chapter Two. The book gives the source code, and the result of compiling/running the module, without even hinting at the fact that the necessary Makefile isn't given until much later in the chapter. In the third chapter, we are introduced to the 'scull' module, a software-based character driver. It is used throughout the first half of the book as an example, with each section adding new functionality to it. In the second half, 'sbull' and 'snull' (scull's block- and network-driver cousins) are introduced.

As I previously stated, the first eight chapters deal with such things as debugging a running kernel (considered by many a black art), racing/concurrency issues, writing atomic code, and how time is handled by the kernel. Finally, in chapter nine, the reader is introduced to actual hardware (in the form of a simple parallel port driver). Interrupts are the subject of Chapter 11, and the rest of the book is on more specialized topics such as Network Drivers, the USB Subsystem, and PCI Drivers, although there is a short chapter on Kernel data types shoved in the middle somewhere.

This is not to say that the book was all bad; on the contrary, the content was excellent! Before reading LDD, I was completely lost when it came to answering Kernel-related questions, whereas I now feel ready to tackle some of the questions that people ask me. (Like how to implement non-blocking I/O, 'Why isn't printk showing up on my console?', etc.)
The book provided clear, concise explanations of everything, without trying to do too much. Several times throughout the text, the authors skipped over topics outside the book's scope, referring them to other books, articles, and websites.

At the end of every chapter was a summary of all functions and data structures introduced in that section. This was a very useful reference, especially as the chapters got longer and more complex (such as PCI Drivers or ksets), as it would potentially take five minutes to find the function defintion you wanted.

Bottom Line
Linux Device Drivers is definitely a good book for anybody looking for an introduction into writing kernel modules for Linux. It toes the line between oversimplified and unneccesarily complex, and does a very good job of staying on topic. I went from a complete kernel newbie to having a very comfortable knowledge of how modules work, and more omportantly, how they are written.
Unfortunately, LDD was a bit unpolished and seemed very rough around the edges. There were numerous cross-references to either non-existant sections, or to sections in the wrong Chapter. The number of typos was also disconcerting, and it didn't have the O'REILLY feel to it. Over all I give it:

3/5 Penguins
--
Andy Kissner
lakerdonald is offline  
Old 08-10-2005   #2 (permalink)
dylunio
Linux Guru
 
dylunio's Avatar
 
Join Date: Aug 2004
Location: Cymru
Posts: 4,157
Grand review lakerdonald, I must check it out, though I might wait untill the next edition when they may have done some editing on the typo's etc, since such things drive me up the wall.
__________________
Registered Linux User #371543!
Get force-get May The Source Be With You
/dev/null
/dev/null2
dylunio is offline  
Old 08-10-2005   #3 (permalink)
Morgoth
Just Joined!
 
Join Date: Feb 2005
Location: Delft, Holland
Posts: 95
O'Reilly book store

You can download the book for free here.
__________________
Civilization is the progress toward a society of privacy. The savage's whole existence is public, ruled by the laws of his tribe. Civilization is the process of setting man free from men.
-- Ayn Rand - The Fountainhead
Morgoth is offline  
Old 08-10-2005   #4 (permalink)
lakerdonald
Linux Guru
 
lakerdonald's Avatar
 
Join Date: Jun 2004
Location: St. Petersburg, FL
Posts: 5,039
Quote:
Originally Posted by Morgoth
O'Reilly book store

You can download the book for free here.
That's pretty rad.
__________________
the lost art of found sound
lakerdonald is offline  
Old 08-12-2005   #5 (permalink)
shlomobauer
Just Joined!
 
Join Date: Aug 2005
Posts: 1
Book is useful, but ...

I am working my through this book as well. Chapter presents an example driver and also directs you to first compile the kernel. Having never done so, and without any real pointers one must stop reading the book and then tackle the kernel building / loading issue.

The book presents a little, "hello, world" module, but doesn't tell us where to put the file - in the much later given makefile, one can see that they have put the file in a directory, "misc-drivers" but there is no reason for me to be constantly guessing about this stuff.

Not surprisingly, you can download an example tar that has all of the code in the book and a makefile that you can study. In chapter 1, the authors tell us where to find the example tar file, but alas, the url is not right (I'll leave at as an exercise for the reader to find the correct url). Unfortunately, in chapter 2, the authors don't tell us that we really need to have this example tar file (they remind us that they told us about it in chap 1).

Ok, that's my rant.
shlomobauer is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 10:40 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0