Drivers

Mar 28, 2008 21:15

I saw this story: http://tech.slashdot.org/tech/08/03/28/0326209.shtml which says that 28.8% of Vista crashes were caused by NVidia's drivers. Now, I've developed drivers for both windows and linux before, both as part of my day job. Neither time was writing device drivers my whole job, more something that had to be done alongside my other development work, and although I expect NVidia probably has fulltime driver writers, I imagine many others are in the same position I was in.

There are many differences between writing drivers for windows and writing them for linux, but one major one has stuck with me, and prompted me to write this post. Generally the way it works is you find an example that's as close to your hardware as possible, and modify it to suit your needs (largely because the documentation sucks, so this is the only way you could - though the publicly available docs for linux are better in this regard, in my experience).

Microsoft provide a device driver development kit, with an example of each type of driver. These demonstrate how to hook into the right bits of the OS, and only that. (The one I was working from had a comment "// HACK HACK HACK", though didn't explain what wasn't really suitable for real world use.)

Linux, on the other hand, provides the full source code to all the drivers. Real life drivers, with all the error conditions handled properly. No hacks.

My drivers weren't for the same hardware, but my linux ones were easier to develop and worked solidly, whereas the windows ones occasionally caused the OS to lock up. (No doubt a bug in my driver, I'm not blaming MS here, just pointing out what I think is a very important factor in what determines the quality of a driver.)

PS. No, you won't have the linux drivers in your kernel or the windows ones on your system, the hardware was never publicly released in that form. (It actually ships with only DOS drivers. Still.)
Previous post Next post
Up