Friday, February 16, 2007

It's better than a binary only driver..

Recently, Greg K.H. made an offer to write free linux kernel drivers to any company that will provide him with docs to their hardware. Some BSD folks had a problem with Greg making this offer to people who would only give up their docs if the developer signed an NDA. Theo de Raadt chimed in declaring that "it is a fucking farce", which is his usual way. As far as they are concerned, an open source driver without docs is not open at all. That may be so, but I still think having source code.. any source code.. which actually works, is better than having no docs or source code.

It would be nice if companies would hand over docs without an NDA.. that is certainly preferable for everyone.. but some of them just won't, and getting them to hand over docs under an NDA with the ok for someone to write a free driver (be it GPL or BSD licensed) - that's something and it shouldn't be ignored.

Now, if companies start doing this and drivers start showing up as GPL, but without the documentation, you guys can go ask the companies for the docs yourself (with or without NDA) and make your own driver using the GPL driver as a reference implementation.. or you can reverse engineer the GPL driver, it's certainly a hell of a lot easier than trying to reverse engineer a binary driver isn't it?

I'm sure Greg and his merry band will be pressing for docs without NDA, but in the event that an NDA is the only way forward, it's certainly better than no driver at all.

Finally, just let me say, docs are not the be all of driver development. Great to have them, but docs can be wrong and you won't have any idea until you implement them. At least a driver, you can test. So unless you intend to start asking hardware companies for their VHDL, you're better off having a working source code driver to confirm the docs (if you can get em) are accurate.


  1. This is an interesting issue, which goes to the heart of program comprehension.

    If I have source code, do I understand better? It depends on the source code quality: how it is written, how well commented it is, and something you can't directly see by inspection, how well tested it is.

    There is also the question of understanding hardware. The original hardware manufacturers understand their hardware the best. But do they understand it totally? There may be timing issues that they aren't aware of. The Windows driver might work only because of accidents of the particular compiler they used.

    However, seeing one implementation that works is invaluable. Sometimes the Windows driver will work better, and it will still be necessary, even with full docs, to reverse engineer the best driver to try and replicate whatever it is doing right.

    So I think that the original manufacturers will always be in the best position to write all the drivers. If they don't have the time, or don't care that much, then getting someone from the community to do it is the next best thing. If that community person is lucky or good, it will be a good driver that others can replicate. It he is unlucky or isn't thorough, you might get a flaky driver that sometimes doesn't work, or has way worse performance than it could have. Like any piece of software.

    It seems to me that "forcing" manufacturers to document their hardware well is rarely going to work. They are under commercial pressure, and can't afford to do the job we'd all like them to do. Plus, even though they designed their hardware, there can still be aspects of it that they don't know about.

    It's a bit like code. Sure, it's nice to have documentation to tell you how the thing works, but the code says exactly what the processor should do. Yes, it's nice to know why this bit has to be toggled when code x appears in i/o port y. If the manufacturer tells us, that's best. If not, we can infer it using reverse engineering. Yes, that's wasted work, but the world is full of wasted work caused by information hiding (patents, trade secrets, etc etc).

    So overall: I see this offer as useful, and overall an improvement to the state of open and free software. I leave the arguments of philosophy to others; this just seems like a positive step to me, reflecting the commercial reality of today (whether you agree that things should be that way or not).

  2. re: apple

    I understand that, and I've interviewed and been hired by many of the large players in the industry in the US, it was mainly their overall demeanor that I found inflammatory- being told 'well while i can understand that you *supposedly* do this for a living, i was asking for a *real* answer' just put me over the top, between that, their half-duplex phone, and their telling me that priv seperation is wrong I just finally said screw it, I'm not this desperate for a job.

    FYI as for a little background on me, im currently employed as a researcher for the company you mentioned in your comment to me.

  3. Hello,
    This is really amazing information found here... I would like to say thanks very much for sharing this keep it up!