Tutorial on Linux Device Drivers 29
vorsprung directed my attention span of a gnat to
Linux Device Drivers Demystified, an interesting tutorial giving an overview of Linux device drivers (No kidding). As well, they've got
devtective, a search facility to check any (Surprise!) devices you want to check to see if they are supported currently. Lastly, for those of you who really want to get into it, read the review of Linux Device Drivers.
Re:Don't encourage binary-only drivers (Score:1)
Excepting binary only programs and drivers will allow companies that would normally not provide Linux software into it. I know the lack of binary only exceptance is a big reason why many firms don't get into porting their code to Linux. They think that they have to publish the source and they really can't. So you can't use their really cool scanner under Linux. I think that the more support we have, the better.
Informative, but the title's a little misleading (Score:3)
Nothing in here I didn't already know, and I am far from an expert. I thought from the title it might have info on how to *write* drivers (the O'Reilly book's probably a bit long in the tooth by now, correct me if I'm wrong about that).
None of this is to take away from the article itself; it was well written, and you shouldn't try to compile your own kernel without knowing what it tells you.
It should probably have been called a "Primer" instead of a "tutorial".
Re:Informative, but the title's a little misleadin (Score:1)
The rest is accurate and decently writeen, if basic (which is fine).
It's also heavily
-Doug
Actually, the O'Reilly is fine (Score:3)
Furthermore, I would recommend it wholeheartedly. The examples cover what you need, but are simple enough to pick up quickly. With this book I picked up writing device drivers within a day.
Misleading. (Score:2)
That, of course, is what it actually covers. In other words, if you're searching for the latest OpenGL drivers for 3DLabs video cards, you'll be sorely disappointed. Ditto if you want to find the ALSA homepage.
If it ain't in the kernel, it ain't going to be in their search engine either.
Re:Informative, but the title's a little misleadin (Score:1)
I don't know why they're trying to compare the two, as things are completely different.
Finally, I can see people complaining that "there's no
Re:Actually, the O'Reilly is fine (Score:3)
Re:Misleading. (Score:1)
For real cutting-edge stuff that you can't find in their search engine, a look at the Hardware Compatibility HOWTO, a search of www.deja.com for something like "Linux 3COM OfficeConnect", or a specific HOWTO like the Ethernet HOWTO would help.
Oreilly Book (Score:3)
I really wish that a 2.2 version of the book was available. It sucks having to second-guess everything you read: "the book says foo. Guess I better go hunt on the web for a while to see if that's still the case".
A little too 'newbie'. (Score:2)
Don't encourage binary-only drivers (Score:1)
Who's side are you on?
Re:The Linux community demands the wrong thing!!! (Score:1)
It's good but... (Score:1)
Still it's Linux documentation and anyone who writes this stuff deserves praise - but please fill it out a bit! Maybe turn it into a HOWTO?
What's really needed... (Score:4)
Ideally, all an engineer should need to do is find a driver for the device most similar to his/her new device, and follow some general steps in indentifying and making the necessary adaptations. In a perfect world, the engineer would understand the Linux kernel inside and out, but chances are he/she will be completely Linux-ignorant, and will have a matter of a few weeks in which to produce the driver. Thus it would be helpful to draw parallels to Windows drivers (which are likely to be already available or at least more familiar to the engineer), and perhaps cookbook methods for translating them for Linux. Put a limit on theory, history, and other details that don't help the engineer get the job done, fast.
I know that this attitude might be a bit controversial, but in the real world, non- support for a prefered device is a frequent show-stopper for Linux. Let the open-source community work on making the drivers work well--but there has to be a driver in the first place.
Let's hope Alessandro Rubini, or someone of his knowledge and abilities, can produce such a book. It's one of the more crucial issues blocking Linux World Domination(tm).
New Revision of Device Driver Book Needed (Score:5)
I own the "Linux Device Drivers" by Alessandro Rubini [amazon.com]. It is a good book for learning the (somewhat) confusing driver interface under Linux. However, I think a new revision of this book is needed to address things like:
Tuning your device drivers; specific hints for character drivers, block drivers, and net drivers.
A special section devoted to writing and maintaining a kernel version independant, mostly binary, device driver (for more closed companies). This could yield a wider base of companies that support Linux, as they don't want to, "give away the family jewels."
What we need is the definitive guide. A portable, referrable, assemblance of all Linux device driver knowledge to promote the growth and acceptance of Linux as an O/S in the buisness and even the hobbiest communities. Such a book would also raise the bar for performance within the average driver-- something which would help Linux win those benchmark tests. To support this argument, approach your favorite monolithic hardware manufacturer and ask him what tools they are using to support Linux into the future. If they answer with:
If I could write, and could write good enough driver code, I would do it myself.
-AP
Recommendations? (Score:1)
I'm going to attempt to code a driver for the "IBM Wireless LAN Entry" PCMCIA card. Is anyone else working on a driver for this device? I really think a driver for this is needed since these cards are only selling at about $30 *tops* now and will do about 350k/s.
Re:New Revision of Device Driver Book Needed (Score:1)
Device drivers are complex, and when it comes to hardware and lowlevel stuff. There is never going to be a definitive guide, because hardwares and low level stuff change at an alarming rate and vary on different systems. The purpose of the book is to start you out on your path to device driver hacking. It shows you the basic ideas, and you figure out the rest. The reason companies are not writing drivers is not because of lack of adequate documentation, but rather because they don't seen any profit, yet. I mean, what you are asking for is a device drivers BIBLE, the truth is that such stuff will be obsolete in 2 years, and it will take 3 years to write. It will also be much more complicated for newbies to grab.
Can you imagine grabbing a 2000 page book on coding device drivers? Holy Smoke, I do shit my pants if someone gave me such stuff to read. A 100-200 page book which is quite, concise and very clear is what is needed. "Linux Device Drivers" does that, it just needs to be updated often, hopefully online wise, because I definitely can't afford to buy a new version every year.
Ignore this article... (Score:3)
So... read this if (a) you don't know what a kernel is (b) the idea of recompiling it scares you (c) you just want to use your distribution, and not know where it came from. Anyone else, just ignore it.
The Linux community demands the wrong thing!!! (Score:3)
Solaris Device Drivers
AIX Device Drivers
*BSD Device Drivers
HPUX Device Drivers
Windows Device Drivers
Not many I guess, Do you know why? Because not everyone hacks device drivers. Yet the linux community has one, and is whining whining. If you can't start out with that, you are not cut out for the job, please go back to your PERL scripts. The problem we have today with hacking device drivers it not that they are hard to code, but rather lack of information on the hardware! Thats right, What device on earth do you think we can't hack a driver for? Having a 10000 page manual on hacking device driver is useless if companies will not release information on hardwares. So rather than stay here and ramble on books, why don't we all
Re:Don't encourage binary-only drivers (Score:1)
I have a simple question to ask of you:
Would you rather have support for a piece of hardware, broadening the support-base and encouraging the poliferation of an O/S, or not?
Currently, there are a lot of companies that ship binary only drivers for other operating systems. In Linux you have more of a choice than you do under other closed-sourced O/Ss. Understand that you could decide between the vendor's that ship open-source and closed-source drivers. Althought I would prefer an open-sourced driver, I certainly would not deny the extra choices presented by a few closed-source ones.To make another point, there is plenty of code that is used with the Linux kernel that is closed source. Some hardware manufacturers distribute binary-only firmware packages along side their driver. They implement a bare-bones open(), read(), write(), seek(), and a few ioctl() routines that nearly act just as wrappers to some logic down at the board level. Why would manufacturers do this?
Who's side am I on? Well, I would have to say mine. I think that Linux is nice and all: but I pick the O/S that pays the bills. If a customer wans NT, Solaris, SCO, or Linux: I will give them what they want. I think of Linux as I think of a screw-driver: just another tool in my toolbox.
-AP
I'm baffled... why? (Score:1)
Whoever needs such material will find it at the proper sites (from which it should be linked). Are you going to start featuring rc-script customization next?
Re:New Revision of Device Driver Book Needed (Score:1)
Yes, I am acutally asking for hard documentation for the Linux APIs. This is not an absurd request.
Has the PCI spec changed dramatically in the last 3+ years? Sure it has been revised, but not enough to greatly affect driver code! I am not interested in hacking out a driver, I am interested in coding one, professionally, for my company. Yes, my company (as wrong as it is) decided not to author Linux device drivers becuase of a lack of documentation and a high learning curve. This is changing.
I can imagine a 2000 page book. I have seen simular books on algorithms. I have seen simular books about plants, war, or birds. Size does not matter.
-AP
Re:The Linux community demands the wrong thing!!! (Score:1)
So rather than stay here and ramble on books, why don't we all /mail companies and tell them we love Linux and would love their device supported on it?
Heh, these days my favorite companies are the ones who produce devices which have Linux drivers readily available. Since I can now find Linux-compatable drivers for most classes of devices, I don't worry about this stuff too much anymore.
Read the Bible(TM) (Score:1)
Re:New Revision of Device Driver Book Needed (Score:2)
As for a big book....most programmers I know love having a big fat reference manual. You don't read them, you search for what you need when you need it. The i2o spec is massive but I couldn't get anything working without it.
I don't like MS but by publishing a lot of information on their APIs they make it easy for developers to write for them. This attracts business and other users.