Slashdot Mirror


Writing a Linux Device Driver on Company Time?

DriverSubversion asks: "Excuse the anonymity: I'm covering my back and that of my company. My company makes some USB and PCI peripherals, currently only supported under Windows. Several of us have pointed out that there is a large cross-over between the people who buy these things and the people who run linux - and thus it's in the company's best interest to develop device drivers for Linux,as well as Windows. Now while our boss is kind of convinced that this might sell some more units, he understandably wants to know how much it will cost to write and maintain the drivers... and where better to ask than here? So has anyone else gone though this? On scale of 1-10, how hard is it, (1 being 'extremely easy, 2 programmers could do it' and 10 is 'a team of no less than 20 programmers, lawyers and salesmen'). Keep in mind that our intent is to keep the code up-to-date, GPL-compliant and in at least some major distributions."

65 comments

  1. I have no idea by CableModemSniper · · Score: 5, Funny

    But I want some shiny new drivers, so I'll say its a 1.

    --
    Why not fork?
    1. Re:I have no idea by Anonymous Coward · · Score: 2, Informative

      Perhaps a quick visit to the SciTech Website would be in order I am running their SciTech SNAP Graphics for Linux driver(s) currently... from what they say on the site they support 200 graphics cards in their OS/2 product and around 125 in their Linux product. So it would appear that they would be a good group to speak with... by the way I am running an i865 on one system and an ATI rage on the other and the same driver works great on both - may even be faster than the XFree86 drivers! you can find contact information for SciTech here:

      http://www.scitechsoft.com

      from my experience their support team is very good and can most likely give you some answers

  2. reading by The+Clockwork+Troll · · Score: 5, Informative

    This book might shed some insight.

    --

    There are no karma whores, only moderation johns
    1. Re:reading by trendyhendy · · Score: 5, Informative

      And you can read the whole thing for free here.

    2. Re:reading by Yohahn · · Score: 5, Informative

      With this book, if your devices aren't anything too obscure (i.e. it fits in a traditional class of device) it will be easy. It is a fairly straight forward book.

      (You may also want to look at the porting to the 2.6 kernel series that has been written over at Linux Weekly News As an aside, I'd really advocate subscribing there.)

      When your device is a new class of device that linux isn't used to, it can be harder (e.g. when the phonejack cards came to linux, a new api for them had to be made).

      Note, I've only limited experience, but this is what I've observed.

    3. Re:reading by trouser · · Score: 3, Informative

      I was about to post the same thing. This is a seriously useful book. Some excellent examples which will enabled a C programmer familiar with the standard tools (ummm, GCC and a text editor) to write a skeleton driver and hook it into the kernel in no time. Then all that stands between you and freedom is stealing an intergalactic space craft.

      --
      Now wash your hands.
  3. USB drivers are pretty easy by n1ywb · · Score: 3, Funny

    For part of my college senior project I developed a linux USB device driver. It wasn't too bad, working on it part time I went from nothing to something that I could probably release in about two weeks. It was the first real linux device driver or USB project I had ever worked on. Of course I kick ass daily.

    --
    -73, de n1ywb
    www.n1ywb.com
    1. Re:USB drivers are pretty easy by Enry · · Score: 1

      A good portion of the USB subsystem seems to be the result of a college project.

      Try finding out what this means:

      usbdevfs: USBDEVFS_CONTROL failed dev 10 rqt 128 rq 6 len 18 ret -110

      Google has lots of questions asking, but noone answering.

    2. Re:USB drivers are pretty easy by n1ywb · · Score: 1

      I didn't mention how I had to delve into the USB subsystem source on several occasions to figure out how to get my driver to work right. A lot of it has been in flux recently, and many of the example drivers I was working from called deprecated functions and/or macros.

      Don't forget, the source is the documentation.

      --
      -73, de n1ywb
      www.n1ywb.com
    3. Re:USB drivers are pretty easy by Anonymous Coward · · Score: 0

      > Don't forget, the source is the documentation.

      The source is the programmer documentation.

      To expect it to also be the end user documentation is just fucking stupid.

    4. Re:USB drivers are pretty easy by jo42 · · Score: 1


      Read The Source, Luke!

  4. It's pretty easy by Anonymous Coward · · Score: 5, Interesting

    One programmer could write a usb driver for your device in a matter of days. The hardest, absolutely the hardest thing about writing a driver for linux is getting the docs on the chip, and those docs being complete and accurate.

    Maintenance is very easy, however 2.0 -> 2.2 you'll have to do something, 2.2 -> 2.4 you'll have to do something, 2.4 -> 2.6 you'll have to do something, 2.6 -> 2.8...the linux croud delights in changing everything around. Revisionist thinking and all--if it's clean now it was never ugly, dirty code before. The cleanest code in linux is in the device drivers themselves. The infrastructure the device drivers use is, well, less than fresh. And if anyone tells you RTFM ask them where is TFM?

    1. Re:It's pretty easy by leviramsey · · Score: 3, Insightful
      Maintenance is very easy, however 2.0 -> 2.2 you'll have to do something, 2.2 -> 2.4 you'll have to do something, 2.4 -> 2.6 you'll have to do something, 2.6 -> 2.8...the linux croud delights in changing everything around.

      If you can convince the PHBs to release it under the GPL, then you don't have to spend time or money maintaining it. One of the kernel janitors will probably port it to new kernels.

    2. Re:It's pretty easy by Micah · · Score: 3, Insightful

      If you can convince the PHBs to release it under the GPL, then you don't have to spend time or money maintaining it. One of the kernel janitors will probably port it to new kernels.

      Maybe, but I hope you don't give hardware companies those kinds of ideas.

      A hardware company really should, ideally, maintain the drivers for their own products AND work with the kernel janitors or maintainers to keep an up to date copy in the Linux kernel sources.

      The kernel guys do great with most of the drivers they write, but it seems like it's best for the hardware company to do it 1) out of courtesy, to prevent others from having to maintain drivers that make the company money, and 2) for quality control -- the community might not know how to get the most out of the device.

    3. Re:It's pretty easy by drinkypoo · · Score: 1
      A hardware company really should, ideally, maintain the drivers for their own products AND work with the kernel janitors or maintainers to keep an up to date copy in the Linux kernel sources.

      I really think that just accurately documenting your hardware and providing the documentation for free or a nominal distribution cost (which should then imply some nice hardcopy AND a digital copy) is sufficient. I don't feel companies have any responsibility to maintain anything.

      Remember, money talks. So buy devices from companies which DO support linux, if you feel strongly about it, and if the pennies add up, then companies will start caring.

      Meanwhile, even buying a product without good linux support leads the way toward good linux support, if you use it under linux and you bought it because you could do so. If lots of them are sold then it proves there's a market for them, and if enough people want to use them under linux, that becomes a point of competition.

      With that said, it would be great if everyone wrote and released linux drivers for all their products, in source form or not. I do think that if they want to release binary-only drivers, then they have a responsibility to their customers to keep their drivers up to date, but personally, I'm just happy to have open-source drivers, as long as they basically work.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  5. Hmm by GigsVT · · Score: 5, Interesting

    Well, from reading the source of a couple drivers, it looks like most are one or two person deals.

    3ware, for example, is a company that provides open source drivers that have been accepted into the linus tree. They seem to be primarily written and maintained by Adam Radford alone.

    There's also a userspace component to manage raids, would your devices also need userspace apps developed to make them useful? That's one question you have to ask.

    Anyway, good job. It's always good to see devices with open source drivers that don't suck. (Make sure yours don't :)

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
  6. Driver complexity is the tricky point by tzanger · · Score: 2, Insightful

    Take a look at many of the USB serial drivers; tiny drivers, very clean. The USB storage drivers, same thing (assed-up hardware is the reason for complexity in those drivers).

    Writing a device driver for Linux is no more difficult than writing a device driver for Win32. You're in Ring 0 (for ia32) for both, so a poor driver can cause the system to come down. My suggestion would be to take a look at what you've written for win32, estimate how much of that you can keep, and write the linux kernel abstraction layer code.

    If you've written the driver correctly it shouldn't be a very large task at all, I would imagine.

    1. Re:Driver complexity is the tricky point by Anonymous Coward · · Score: 5, Insightful

      This was not an insightful comment. Win32 drivers are a lot more complicated. In Linux, there isn't much to implementing the file operations block, and going from there. In Windows, managing those IRPs and power management requests is a lot trickier. The NT kernel API gets tricky, and learning about the IRQLs and all of the NT kernel features is really hard. Plus, you don't get kernel source. It's a real pain in the ass. If I were given the assignment of writing a Linux driver vs a Windows driver, I'd take the Linux driver -anyday-. It's infinitely easier.

    2. Re:Driver complexity is the tricky point by egoots · · Score: 1

      Writing drivers for windows has gotten so complex the Microsoft is working on a new driver framework called the "Windows Driver Framework" to try and simplify it and to get more robust drivers from 3rd party developers. You can read an introductory article here by Walter Oney... it is very enlightening and highlights the various issues that a driver writer has to know at a very deep level to write even the simplest driver these days.

  7. Easiest way to create/maintain a driver by Anonymous Coward · · Score: 5, Insightful

    The easiest way to get a Linux driver would be to give find an interested developer, give them a free device and detailed documentation, and answer any questions they have. If you're working on a tight budget, this might be the best option.

    There are lots of people who attempt to write a driver for a device, but fail only because the manufacturer won't give them information. IMHO, this doesn't make much sense - if someone wants to help you out for free, why would you stop them?

    1. Re:Easiest way to create/maintain a driver by CodeShark · · Score: 1
      if someone wants to help you out for free, why would you stop them?

      Answer #1: the GPL.

      Now then, before the flames start -- please keep in mind that I am a staunch Open Source advocate, okay?

      Let's say that the interested, free developer writes the hottest Linux driver imaginable for the manufacturer's wonderful version of gadget A. The open GPL code base for the driver is also an open book to the implementation of the hardware & chips inside the gadget, whether for cracking, hacking, writing twisty benchmarks, or reverse engineering, etc.

      Answer #2, related in part to #1: DMCA and/or liability concerns.

      What if an outside party writing the device driver opens platform specific implementation details to the outside world that would not otherwise have been visible?

      How many bosses right off the bat are going to risk those types of problems just to save the cost of a coder for a couple days. It costs ten times that much to get the compliance and legal issues worked out.

      So usually the answer to getting a driver written for a specific device is getting enough market interest in front of the PHB and bean counter types to make it worth their interest in risking the relatively small investment required for the coding itself and do it within the constraints of their own trade secret agreements, NDAs, legal reviews, etc.

      --
      ...Open Source isn't the only answer -- but it's almost always a better value than the alternatives...
    2. Re:Easiest way to create/maintain a driver by sjames · · Score: 1

      Of course, that leads to my rule of thumb for hardware selection. The more secretive a company is about how to simply interface with their product, the crappier it is. There are only a few reasons to be afraid:

      Fear that someone will clone the chip: If it's that easy to clone from nothing but a register spec, it's nothing special, move along. If it's meant to be a low cost item, it must be too expensive. If it really was the cost leader, no amount of cloning would harm it.

      Embarassed about the tech details. That is it's either riddled with bugs requiring software workarounds, or it's one of those 'bargains' that saves $5 by using up half of a $100 CPU instead.

      Worried about the security of the device: It uses security by obscurity only. Stay FAR away.

      The drivers are someone elses IP. They don't even understand their own product, stay VERY far away.

      They don't know why, they are just afraid. I'd rather not get entangled with the tinfoil hat brigade myself, I want to do business with companies that make rational business decisions.

      The thing they all seem to miss is that a determined cloner who expects to make a great deal of money by making a cheap copy will not let a little thing like the lack of a data sheet and GPL driver stop them. They'll likely already have all the bus sniffers, romulators and ICE that they need and plenty of experiance using them. The 'secrets' will be had in no time. If it's not profitable enough to do that, then nobody's interested in cloning the thing anyway.

      In the case of a USB device, the scale tips even further towards a GPL driver. A USB sniffer is rather inexpensive and easy to use. If the device qualifies to use the USB logo, it's already quite standardized and so not hard to reverse engineer (unless it's buggy, in which case most people will prefer to buy something else).

      The only people who are stopped by keeping specs a dark secret are people who have no intention of doing the things the manufacturer is afraid of (in other words, potential customers).

  8. PVR cards by Anonymous Coward · · Score: 0

    My strange mind has for some reason decided you work with Hauppauge and you want to finally give us drivers for the WinTV PVR series. Let me say right now if we actually got official working Linux drivers for this to use with MythTV, we'd be eternally grateful, everyone would thank you repeatedly, and we'd buy more cards/boxes =] I'd look at how the ivtv driver's coming... it's GPL by definition, so you might be able to expand on that.

  9. New platforms come at a fraction of the cost. by aminorex · · Score: 5, Insightful

    You don't want the drivers in distros -- you want them in
    Linus' kernel. Don't worry about liason with distro vendors.
    Worry about liason with vger.

    Since understanding the device, finding its quirks, and
    designing protocol is the overwhelming bulk of the work
    of writing a device driver, a reasonable rule of thumb is
    that adding another platform will entail an additional
    10-20% in manpower. Since the gap between a WinXP
    driver and a Linux driver is relatively large, the high-end
    of the scale is a closer approximation: Take the
    development time for the Windows driver and divide by 5.

    Now for maintenance, the new platform cost is much higher,
    because each platform has its quirks, etc. You do get to
    amortize some stuff over the platforms (no need to
    diagnose protocol bugs twice, etc.), but it doesn't count
    for a whole lot, so I would estimate that adding a new
    platform will entail 80-90% again as much in maintenance
    costs.

    However, for an open source driver, you will quickly find
    (if your hardware is at all useful) that the chore of forward-
    porting maintenance as the kernel develops will be largely
    assumed by the user community, so give any open-source
    platform a -25% maintenance cost tick, at least.

    Customer support issues are an entirely different ballgame,
    and depend so much on your audience that I won't venture
    even a guess -- keep in mind that customer support for
    a smaller community typically is less work than is a similar
    level of support for a larger community -- and Linux
    users are accoustomed to self-support and community-support.

    win_cost = win_dev + win_maint + win_support
    lin_cost = lin_dev + lin_maint + lin_support
    lin_dev = win_dev * 0.2
    lin_maint = win_maint * 0.6
    lin_support = win_support * k

    Fill in k.

    --
    -I like my women like I like my tea: green-
    1. Re:New platforms come at a fraction of the cost. by spitzak · · Score: 3, Interesting
      If you release it GPL (or any other open-source compatable license) and your first version works at all (it does not crash & it manages to communicate enough signals that at least a light blinks & it contains enough partially-working code to "document" the device) then I would estimate the maintenence costs by multiplying them by zero. The driver would be immediately added to the Linux source and debugged and improved by users of your device. You would probably also make a bunch of sales instantly.

      The only downside is that legally you cannot take fixes made by those outside users and put them into your closed-source drivers. However it is highly likely that you can ask the authors of the changes for permission to use the code, one way to convince them is to say that doing that is the only way for their code to get into the "official linux driver" that can be downloaded from your web page.

    2. Re:New platforms come at a fraction of the cost. by sigxcpu · · Score: 5, Insightful

      You should also cinsider the fact, that debugging device drivers under Linux, is much easier then under windows, because you have the source of the OS, and if you suspect that there is a bug, you can add your debug code wherever you want and test it. (sometimes much faster then reading the code and trying to find it - something you can't do in windoze anywhay.)

      One company I worked for even developed a linux deriver, it had no intention of officialy releasing, (It was just one part of a bigger device) just to get the ability to debug the the hardware efficiantly.

      (Yes I am a linux kernel programmer.)

      Besides, if your devieces are usefull, the Linux comunity has an intrest in having them work under linux.
      If your device is something of common use, say an IDE controller or a NIC, you would find people willing to help you, or even write the driver for you, if you provid the full documantation and a working sample. (and if you give them a peek at the sources of your working windows driver it will probably be a very simple job. )
      If you are willing to supply these then the right place to ask is on the LKML.

      --
      As of Postgres v6.2, time travel is no longer supported.
    3. Re:New platforms come at a fraction of the cost. by TephX · · Score: 4, Insightful
      The only downside is that legally you cannot take fixes made by those outside users and put them into your closed-source drivers. However it is highly likely that you can ask the authors of the changes for permission to use the code, one way to convince them is to say that doing that is the only way for their code to get into the "official linux driver" that can be downloaded from your web page.

      Or just release your Windows drivers under the GPL. I mean, if you're releasing GPL Linux drivers anyway, then you're clearly not protecting any proprietary interface information or whatnot, and drivers are hardly an item on which you can make a profit by selling them anyway, so it really seems like you don't lose anything at all by GPLing the Windows drivers too.

      Yeah, this is "not the way it's done" and the managers won't agree to it. My point isn't necessarily that this is realistic, but that the people opposed to it are just being stupid.

      --
      I metamoderate all Redundant and Offtopic moderations as Unfair.
    4. Re:New platforms come at a fraction of the cost. by spitzak · · Score: 1
      True that may help a lot as improvements to the Linux driver can then also be put into the Windows driver. Thus you could make a reasonable claim that maintinence costs of the Linux driver are actually negative.

      What I meant, which may still apply, is that you cannot change your mind and make your drivers (either the Windows or Linux ones) closed-source without either removing all the donated changes or getting permission to all the donated changes.

      I'm also under the impression that open-source Windows drivers are impossible as the licensing agreement with Microsoft to get the developers kit disallows that. Is this correct, or is it maybe only true for more complex drivers such as 3d? It does seem possible that it is legal to delete all the Microsoft boilerplate stuff and only leave your changes and open-source that, so there is still a work-around.

  10. WinDriver by Twylite · · Score: 2, Interesting

    I'm not a driver developer, but I've had to look into the possibility of cross-platform USB (and other) drivers before. Do yourself a favour and take a look at WinDriver (no, I have nothing whatsoever to do with the company or the product).

    The initial cost can be a bit steep, but the ROI could well be worth it. The suite allows you to write a USB driver that is source-compatible over Win98/Me/2K/XP/2003, Linux 2.0/2.2/2.4, and WinNT, for USB 1.1/2.0 and UHCI, OHCI, or EHCI.

    --
    i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    1. Re:WinDriver by Anonymous Coward · · Score: 2, Insightful

      Maybe, but what kind of performance cost are you facing? And how are any 3rd parties meant to maintain the driver then?

    2. Re:WinDriver by Twylite · · Score: 1

      Third parties aren't meant to maintain the driver. Performance isn't an issue for USB 1.1 (maybe for USB 2.0, depending on the device), and you're talking about a company that specialises in creating device drivers -- their collective knowledge of performance and stability issues almost certain outweighs what can be achieved by a non-dedicated (to driver development) individual or team.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    3. Re:WinDriver by Anonymous Coward · · Score: 0

      How about drivers for non-Intel architectures?

    4. Re:WinDriver by Twylite · · Score: 1

      Well, WinDriver offers a product for building Solaris drivers ... but not specifically USB ones.

      HOWEVER ... I've defended this position many times before, so I guess I'll defend it again: if you buy a piece of hardware, and the manufacturer doesn't claim to support it on a particular platform, then you can't expect it to be supported on that platform.

      And, from the opposite perspective, a manufacturer has every right to expect that their hardware is NOT supported on other platforms without their approval! Why? Because in many cases the hardware (and thus the manufacturer) gets a bad name, because of a poorly implemented driver.

      This happened with a huge number of modems, printers and video cards that were unofficially supported by free *nix operating systems. Telling people not to buy a particular hardware item because it isn't supported on certain operating systems is one thing ... but telling them "don't buy an XYZ because its shit - it keeps crashing and prints/scans/displays/calls funny" is completely unfair when it works quite acceptably on a platform on which it is supported.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    5. Re:WinDriver by Harik · · Score: 1
      And, from the opposite perspective, a manufacturer has every right to expect that their hardware is NOT supported on other platforms without their approval! Why? Because in many cases the hardware (and thus the manufacturer) gets a bad name, because of a poorly implemented driver.
      They can fuckoff for all I care. If they don't care enough about their product to support it, then they get a bad name. I ONLY buy hardware which works (well) in linux. Why? Because it's usually not a shoddy piece of shit.

      As for "it's unfair!" well shit, I bought it and it works like crap. Perhaps the hardware vendor could get off their fat ass and email the docs to the linux driver maintainer? If they can't do that, well, then they must be hiding how shitty their device is in the first place.

    6. Re:WinDriver by Anonymous Coward · · Score: 0

      I'm a Jungo Representative and I would like to clarify one thing. Jungo does provide special tool for developing USB (1.1/2.0) drivers, http://www.jungo.com/wdusb.html. This tool supports a lot of OS's like Windows, Linux, Solaris and etc. If you want you can download and try it for 30 days free of charge. If you have any other question please contact me.

      Thanks,
      Omer
      omer@jungo.com

  11. Since you make the devices by Anonymous Coward · · Score: 0

    The hardest part of getting stuff to work under Linux is the part where you're trying to understand how the thing works. Since you make the devices, your engineers will know which register does what.

    The actual writting of the driver should be that hard. Writing linux drivers is very well documented and there seems to be a lot of example code at kernel.org *grin*.

  12. Rather flexible situation methinks... by chewy · · Score: 1

    I think you need to look at all the options, and compare them to the long run after-effects it will have on your code. Other harware companies have varying degrees of driver support for linux, so you could maybe try to analyse the market's responses, or maybe see how many companies had to lay off programmers when the going got tough.

    OTOH, if you could somehow just pay one guy to lead the open-source driver effort, even if only part-time, the costs of supporting linux could be quite minimal.

  13. On a scale of 1 to 10. by D.A.+Zollinger · · Score: 0, Funny

    Your complex question requires a complex answer. I would say Pi.

    --
    I haven't lost my mind!
    It is backed up on disk...somewhere...
  14. definitely a 1 or 2, no higher by itzdandy · · Score: 3, Insightful

    I have done some driver work, build and debuging and linux is a driver writers dream compared to windows. I would estimate that a linux driver will consume about 50% as much time as a windows drive writing either from scratch. I reality, you may have a lot or reusable code from the windows drivers so you could be looking at less. Also do take the advice of other posts and get the basic driver out ASAP, and allow the OS community help out on the rest.

    1. Re:definitely a 1 or 2, no higher by Anonymous Coward · · Score: 0

      you are a cum bubble.

  15. Pi isn't complex... by WIAKywbfatw · · Score: 1, Offtopic

    Your complex question requires a complex answer. I would say Pi.

    Pi isn't a complex number (at least not one with an imaginary part).

    2 + 3i, however, is a complex number.

    --

    "Accept that some days you are the pigeon, and some days you are the statue." - David Brent, Wernham Hogg
    1. Re:Pi isn't complex... by GlobalEcho · · Score: 1

      Pi isn't a complex number (at least not one with an imaginary part).

      Sure it is! It has an imaginary part of magnitude P, and a real part of magnitude zero.

    2. Re:Pi isn't complex... by KoopaTroopa · · Score: 1

      That's beautiful. I wish I had mod points today.

      --
      Sharpies don't just sniff themselves.
  16. How long will it take YOU? by YrWrstNtmr · · Score: 1

    That's the question.

    How long will it take for ( some unknown number ) of our ( unknown skill and experience level ) developers to write a driver of complexity level ( X ).

    What resources will be devoted to maintaining it? Documenting it? Adding features?

    Will it be as fully supported as the current Win drivers?

  17. Percentages and Markets by SEWilco · · Score: 1
    Several of us have pointed out that there is a large cross-over between the people who buy these things and the people who run linux ... our boss is kind of convinced that this might sell some more units,

    Oh, your boss noticed that if "several" of his own techs are interested in Linux, that there must be a huge number of techs (and non-techs) involved in Linux? Some companies are awfully slow at figuring that out.

  18. Same difficulty as Windows by ni4882 · · Score: 2, Interesting

    For the most part, writing a linux device driver is pretty much the same difficulty as writing a Windows device driver. The real question is, do you really want to make your driver GPL compliant? See, you'll be giving up some pretty important IP that you may not want to give up. Now somebody else could come along and make a device that behaves exactly like your company's device, just because you gave away interesting tidbits about how your hardware works. Initially you may gain some acceptance and increased revenue for doing this, but in the long run it may end up sabatoging the product you're trying to support. I know I'm probably gonna get flamed to high hell for this, but I'm personally not the biggest fan of the GPL. You may want to contact your HW engineers and lawyers before you dive to deep into doing this. They may have a much different take than you on supporting linux.
    So technically speaking, writing a driver is going to be the same difficulty as far as programming, but much more complicated as far as the business decision involved.

    1. Re:Same difficulty as Windows by Frodo+Looijaard · · Score: 1

      You are not warning against the GPL here, if I understand you correctly, but about opening the device driver source to outside eyes.
      Personally, I never understood how a hardware API would need to give away too much about the hardware itself, but I guess it depends a bit on the hardware itself.
      Then again, if someone wants to clone your hardware, and thinks it will help to have your device driver, they can always decompile the source code and read it (it will take a lot more effort, but that will probably not be a factor).
      So, all in all, I don't see your argument - but I am afraid manangement might see it differently.

    2. Re:Same difficulty as Windows by Anonymous Coward · · Score: 1, Interesting

      ....I never understood how a hardware API would need to give away too much about the hardware itself, ....

      Depends on how much is in the hardware. If the hardware is a bunch of little functional units that are bound together in the driver then you can give away lots. If the hardware is opaque and mega-lithic then you don't give away so much.

    3. Re:Same difficulty as Windows by SagSaw · · Score: 1

      Although generally desirable, there is no requirement that third-party kernel modules (which I assume would be the primary form your driver the driver would assume) be released under the GPL. Thus, being forced to GPL IP you consider valuable is not an issue.

      --
      Come test your mettle in the world of Alter Aeon!
    4. Re:Same difficulty as Windows by flynns · · Score: 1

      This is true. I personally think that the GPL is an excellent idea, and one of the best things that's happened to software in the past ten years.

      However.

      You do have to look at the future of your product.
      Are you the sole supplier of this product? If so, then you may wish to hold on to your code and specifications and attempt to corner the market.

      On the third hand, if you are the sole supplier of this product, it may well behoove you to release the source code for the drivers. This might encourage acceptance by the Linux (and Windows) crowd, as people could write applications that speak elegantly to your device.

      Food fer thought.

      --
      'If you're flammable and have legs, you are never blocking a fire exit.'
  19. from zero to 0.99beta about 1 man month by Anonymous Coward · · Score: 0

    Hi,

    I did this around the time when kernel 2.2 was shiny and new -- proprietary goofy hardware on PCI bus chained to something you could open,close,read,write and ioctl along with necessary /etc/ scripts to set things up and a relatively feature complete user space library to abstract some of the more arcane features of the hardware away in about a month. The driver was not exactly trivial since the hardware was dumb and had to be polled in a soft real-time fashion. Basically poll, dump into ring buffer in kernel space. Reads and writes operated on the ring buffer. IOCTL's controlled the start/stop of polling. Learned much about how page faults are handled. Get Arangelli's book from O'Reilly and rock and roll. Maintenance is pretty straight forward.

    If your company will let you do it make it GPL, otherwise load dynamically.

  20. buying devices with both Windows and Linux support by 4Runner · · Score: 1

    Tell your boss this. I buy alot of computer hardware that needs to work under Linux as well as Windows. If I have the option of buying a device with drivers for both OSes, I will buy it rather than a device with just Windows drivers. You will be loosing out to vendors that have linux drivers as well as windows drivers.

  21. how about OS X? by The+Lynxpro · · Score: 2, Insightful

    Does your company support OS X as well? Just remember that Mac customers tend to have the extra discretionary income to purchase all sorts of Firewire and USB goodies... Be a sport and advocate for a multi-polar OS environment, Win32, OS X, and Linux... I relinquish control of the soapbox...

    --
    "Right now, somewhere in this world, Scott Baio is plowing a woman he doesn't love," - Peter Griffin, *Family Guy*
  22. Get the community to do it. by Jerk+City+Troll · · Score: 1

    Release hardware specifications and document how the hardware works. Maybe even write an initial proof of concept driver. Of course, finding people interested enough in the hardware to write a driver for it is the trick. Just a suggestion...

  23. how hard is it?? by josepha48 · · Score: 1
    I'd imagint that there would be some common code between windows and Linux. That would have to be GPL or out of kernel. I have no problem with binary drivers in my kernel, but some people consider it tainting the kernel. How much IP are you willing to give away under the GPL is what this boild down to?

    You have to be able to do the following: 1) open the device; 2) close the device; 3) read from the device; 4) write to the device.

    Go here (it has info on this): http://tldp.org/LDP/khg/HyperNews/get/devices/devi ces.html

    Basically there is already USB support in the kernel, so you would need to start there. There are many supporting funcitons. Good luck.

    --

    Only 'flamers' flame!
    Does slashdot hate my posts?

  24. Professional experience by gibson_81 · · Score: 2, Informative

    I was hired to do something similar; first, port existing ISA drivers from VxWorks to Linux, then port again from ISA to PCI ...

    The time it takes to port the drivers in itself isn't very much - I spent one and a half year in that company, but that was because that's how long it took them to get the hardware for the PCI device I was supposed to drive working. The actual driver, for working and tested hardware, should be a couple of weeks for one coder, full-time.

    When it comes to complexity, that varies a lot. Since I suppose you've been working on the drivers for Windows, you already know most of the hardware stuff, so yuo won't find it very difficult. Also, the kernel has a number of support functions for PCI (probably for USB too, but I'm not sure on that) which allows you to speak to the device in a fairly "high-level" language. Usually, you just call pci_register_device with your vendor and device ID's, and then you get a pci_device struct for each device the kernel can find. I assume something similar exists for USB.

    I'd recommend getting an O'Reilly book on device drivers, and looking in the PCI and USB subsystems in the kernel; that should be enough. So, to rate the difficulty, I'd say a '1', since much of the code can be shared between the drivers (you could even create both drivers from the same source, with a "kernel mapping library" to interface with Windows/Linux) and since, as many others have already said, the hard part about writing a device driver is to figure out how the hardware is working.

    Oh, and you'll definately want to enable "Magic SysRq" on your development box, 'cause every single mistake your driver makes can cause an OOPS (my favourite was when I accidentially storde the driver name in an auto variable, so every time I tried to unload the driver, I got an OOPS *S*)

  25. Pretty Straightforward by AstroTech · · Score: 2, Informative

    I have written several device drivers for both Windoze and Linux. In my opinion, the Linux drivers were far more straightforward to write and maintain. As long as I could get _complete_ information for the hardware, I would choose to work on a Linux driver over a Windows driver if I were given the choice.

  26. Running around in circles by Webmoth · · Score: 1

    So... you're saying that he'll be running around in circles instead of just cutting straight across?

    (Pi: the ratio of a a circle's circumference to its diameter. But you knew that.)

    --
    Give me my freedom, and I'll take care of my own security, thank you.
  27. u missed this equation by Anonymous Coward · · Score: 0

    lin_users=win_users*0.06. :-)

  28. I too buy the linux supported hardware.... by Anonymous Coward · · Score: 0

    Any hardware that is microsoft only I will not buy unless
    there is no other product available for my customer to
    complete their work.

    Any company that comes out with a windoze only device
    loses my business starting with day one.

    Even when the customer has no idea about linux, there is enough good equipment around that's linux compatible that
    I am still able to give them the best deal with the best equipment.
    I do this only to make sure that any subsequent owner
    of same said hardware WILL have the linux option available
    to them.

    I've been doing this for years.