Slashdot Mirror


Should Linux Have a Binary Kernel Driver Layer?

zerojoker writes "The discussion is not new but was heated up by a blog entry from Greg Kroah-Hartman: Three OSDL Japan members, namely Fujitsu, NEC and Hitachi are pushing for a stable Kernel driver layer/API, so that driver developers wouldn't need to put their drivers into the main kernel tree. GKH has several points against such an idea." What do you think?

22 of 944 comments (clear)

  1. Oh, I'm all for it. by Anonymous Coward · · Score: 5, Funny

    Linux, with the stability of Windows prior to the advent of certified drivers.

    1. Re:Oh, I'm all for it. by LordNimon · · Score: 5, Informative

      It's been a while since I've worked on Windows drivers, but I believe certification also means that the driver has passed Microsoft's very rigorous driver tests. This test suite is much more thorough than anything a Linux driver has been through.

      --
      And the men who hold high places must be the ones who start
      To mold a new reality... closer to the heart
  2. Good idea! by Anonymous Coward · · Score: 5, Funny

    Lets put it in Kernal 2.7.
    Oh wait... OOPS!

  3. Excellent suggestion! by scsirob · · Score: 5, Insightful

    Having a kernel API for drivers allows developers to stay away from the mainstream kernel. This will enhance the stability of the kernel in general and also allow hardware vendors to support Linux with less effort.

    --
    To Terminate, or not to Terminate, that's the question - SCSIROB
    1. Re:Excellent suggestion! by IAmTheDave · · Score: 5, Interesting
      Having a kernel API for drivers allows developers to stay away from the mainstream kernel. This will enhance the stability of the kernel in general and also allow hardware vendors to support Linux with less effort.

      I am not a linux contributor, but I would think you'd kinda want to guard access to the kernel kinda closely. I mean, sure, anyone can fork it or grab a copy to putz around with, but contributing back into the kernel - that's gotta be just about as stable as a piece of code can be.

      Despite some loss in efficiency, I've always been an advocate of abstracted access. To many of the pieces of software we write at my job do we add a logical API, so that we don't always have to open the main code branch every time we want to add a feature.

      Driver developers hardly equal kernel developers. Keeping the two logically seperated makes sense - not to mention that driver developers are hardly the only ones that would benefit from this API.

      --
      Excuse my speling.
      Making The Bar Project
    2. Re:Excellent suggestion! by kmmatthews · · Score: 5, Insightful

      No, because we'd (at best!) get the same crap drivers that windows gets. Childish crap spewed out by the lowest bidder, and it destablizes the entire system. Not to mention that no open source coder can _fix_ the damn thing then.

      Look at nvidias drivers on linux! Always well behind other drivers, and filled with bugs because we have to wait for nvidia to get off thier asses and fix the damn thing.

      What happens in 10 years when you're trying to use that binary driver to recover data from an ancient device? If it was an open source driver, you could fix it to work with your system; binary, you're going to have a lot more work to do.

      --
      feh. stuff.
    3. Re:Excellent suggestion! by robertjw · · Score: 5, Informative

      Just to play the devil's advocate - yes. That is, if you want the average Joe Blow to start even thinking about Linux instead of Windows.

      Your statement has been the subject of several discussions here lately. If you are asking if "I" want the average Joe Blow to start using Linux, the answer is "I don't care". I belive the Linux is an excellent operating system that is stable, robust and powerful. I think average Joe Blow should use it for those reasons. Do I care if he does use it? As long as he doesn't call me to clean up his spyware and viruses, or at least doesn't get pissed when I charge him to clean it up, I'm fine with Mr. Blow using any OS he wants.

      Thing is, if the Linux development community starts making compromises that jeopordize the security and stablility of the OS just to intice ol' Joe to use Linux we haven't gained anything. All of the reasons to use Linux go away and we haven't progressed. Linux has gained market share due to it's quality, stability and performance. Linux will continue to improve and continue gain market share because of these reasons. Eventually a free market should change to embrace a better product. There is no reason to compromise just for short term acceptance gains.

    4. Re:Excellent suggestion! by Dwonis · · Score: 5, Insightful
      It's not that I want to repeat anything, but there are a whole mess of hardware vendors out there that just won't release open source versions of their drivers.

      No, no, no, no NO. We don't want hardware vendors to write drivers. Besides, most hardware vendors don't want to maintain drivers for Windows, MacOS, FreeBSD, NetBSD, OpenBSD, BeOS, HURD, Xen, Linux, Solaris, and each of the incompatible versions of each of them, as well as any new platforms that arise. Even if they do, whether or not they can write good quality, full-featured, secure drivers for all of these platforms is an open question.

      All a vendor needs to do is to make good, solid interface documentation, and make it available without NDAs and other childish restrictions, and the drivers will not only be written, but they'll probably be shipped with the operating systems, and for the most part, just work.

      Companies that specialize in PC hardware should stick to the hardware, and let the software specialists write the software.

  4. No Thanks! by Shads · · Score: 5, Interesting

    No thanks, this is just a great way to promote closed source inside the linux kernel and to make debugging problems totally impossible.

    --
    Shadus
    1. Re:No Thanks! by Speare · · Score: 5, Funny

      Come on, can't we see through this Cathedral-driven charade? There's no rational thought behind Intelligent Drivers. It's all just a dogmatic rehash of the same old Closed Source thinking forced upon our Open Source kernel laboratories! I say, send these Intelligent Drivers ideologues back to Kansas where they came from!

      --
      [ .sig file not found ]
    2. Re:No Thanks! by IamTheRealMike · · Score: 5, Insightful
      Three points.

      • For many companies, there are no benefits to going open source, and only downsides. The pragmatist recognises this economic reality, the zealot (and Greg KG is a notorious one) doesn't want to hear it. For instance, let's say nVidia GPLd their driver and got it accepted into the main tree. This gives them a competitive disadvantage because ATI or other companies can now look at how their drivers work with much less effort. It doesn't save them any work, because the community would still expect them to maintain the drivers and add functionality to them (and indeed, for cards that are new to the market or in development, they'd be the only ones who could). And there's no guarantee the drivers would be accepted anyway - simply using the wrong coding style is enough to cause problems in the kernel project, let alone doing the sort of things the nVidia drivers do (for instance they used to use a custom TLS scheme).

        Because of this, I'm 100% not convinced making binary driver developers lives harder changes anything. Are large businesses (the type who make hardware that's difficult to reverse engineer) likely to say, hey, gosh, you know this Greg KH guy kind of doesn't like closed drivers, maybe we should open them up to please him? Nope. They'll just work around the difficulties or not provide drivers at all.

      • It's not "impossible" to debug binary software. Please. This is a crappy excuse kernel developers regularly pull out of their asses to confuse people who haven't done much software development. What they actually mean is, "I don't really want to" (and if unloading the driver makes the crash disappear, that's a pretty good way to shift the problem onto the driver manufacturers anyway).

        I've been a Wine developer for years and have spent many hours doing this impossible thing of which you speak, and your average copy of MS Word or Steam is a LOT larger than your average driver. Yes, it's hard. No, it's not impossible. I've heard various excuses as to why kernel development is just different!! to userland software development, and don't buy it. Yes, having to reboot when a crash occurs is a royal pain in the ass, but so is not being able to get a backtrace because the game you're investigating treats any attempt at attaching a debugger as an attempt to hax0r its copy protection. Different space, different challenges. It's still possible.

      • A stable binary module interface would help open source developers too (even if it only existed for a single 2.X series at a time), as new software which relies upon kernel modules or drivers would become much easier to distribute and install for non-technical end users. Take for instance ZeroInstall. The main developer, Thomas Leonard, since abandoned the original (imho quite elegant) approach of using a networked VFS because it required users to install a kernel driver, a task which proved hard to impossible for many non-developers. So the whole thing was rewritten to do things a different way and avoid the kernel, despite that coming with some disadvantages. We've also looked at using a kernel module to fix various speed issues for Wine in the past, but the difficulty of getting even minor patches accepted into the kernel let alone major new subsystems nixed that. If there had been a stable module interface we could have skipped all that and gone straight to improving things for end users without having to worry about what kind of indenting or list structure we should be using.
  5. Why post this link without the followup? by rRaminrodt · · Score: 5, Informative

    http://www.kroah.com/log/2005/11/07/#osdl_gkai2

    Some misunderstandings were made. But of course, if they posted this link, there'd be no point to posting TFA or the arguments that will almost certainly follow. :-)

    --
    They'll think I've lost control again and leave it all to evolution. -- Supreme Being, Time Bandits
  6. Solves the reason why I gave up Linux by s20451 · · Score: 5, Interesting

    I gave up Linux mostly because I was tired of getting punished for having new hardware, which is often unsupported. Especially on laptops.

    If you don't force the manufacturers to include their driver source in the kernel, you might get them to release actual drivers for their new hardware.

    --
    Toronto-area transit rider? Rate your ride.
  7. Stability like that leads to stagnation and death by A+nonymous+Coward · · Score: 5, Insightful

    One of Linux's great strengths is the flexibility of changing to meet new needs and not being hobbled by rigid backwards compatibility. This can only be done if all source is open and anyone can update drivers to meet new needs. When someone comes up with a patch to streamline a certain minor part of the kernel, it frequently has repercussions elsewhere in kernel land. It is these small changes which have made linux better and better with breathtaking speed. A "stable" binary API removes the possibility of keeping everything up to date and would dramatically show down the adoption of new features and general improvements.

    Continual refactoring is worth far more than some supposed binary API which prevents changes. Get rid of binary drivers! If companies are so paranoid that they want binary drivers, then the hell with them. Linux can advance better without that baggage.

  8. As the article says, it's illegal, and a bad idea by SWroclawski · · Score: 5, Insightful

    These companies want a binary layer so they can build binary drivers.

    What people tend to forget about this is that it's a bad idea- from most every perspective.

    The Linux kernel was written as a Free Softwate alternative to the existing *nix systems.

    We have thousands of drivers in the kernel from a combination of development efforts. Sometimes a driver is written by an independant kernel developer, and sometimes it's written from the company producing the hardware, working alongside the community.

    What these companies want is to be able to have thier cake without giving back to the community. This is a very slippery slope at the least, and illegal at best, since these sorts of links to binary kernel drivers have been long known to be illegal to distribute alongside the kernel (unless special previsions are made, such as a userland driver).

    Also, binary drivers have been known to be buggy and essentially removie the kernel developers from a position where they have control over the kernel as a whole project. I won't even go into the issues associated with a possible security hole in a binary driver, or a binary driver with, for example, spyware in it.

    The arguement for it is, of course, that this might mean more drivers. This is a test of our strength as a community. Doing the right thing is harder. It means we won't have all the hardware at all times, and certainly not the newest thing. But we retain control over our computers.

    It's hard to say no, but this looks like a clear case where we have to.

  9. Re:Amen! by Krach42 · · Score: 5, Informative

    This is very welcome but unfortunately, I think they'll fail. There is just too much politics surrounding Linux these days.

    It is not welcome. Linux is about Open Source, and allowing people to link-in binary closed drivers goes against this.

    Too much politics surrounding Linux? Where have you been? It has been the policy of the Linux kernel for a long time that it would never stablize a binary driver interface, in order to prevent people from not making their drivers open source.

    The idea behind Linux is that an Operating System should be Open, and Free (as in speech), and that nothing should hinder this. Binary drivers are exactly this sort of hinderance.

    You may be upset that you don't have drivers for product XY because that company doesn't want to play along, but if you're trying to change the way the world does software, you can't go "ok, just because we *really* want your drivers, we're going to bend the rules for you."

    --

    I am unamerican, and proud of it!
  10. Userspace, anyone? by ettlz · · Score: 5, Insightful

    IANAKH, but couldn't more drivers be moved into userspace (or other lower rings) --- especially for things like USB printers and miscellaneous gizmos? I think it would also be nice to not bundle thousands of drivers and support for architectures I don't have with the kernel. The kernel itself could provide a very minimal layer of hardware protection (like an exokernel?) and there'd be libraries exporting generic abstractions for particular classes of hardware. Is the context-switching penalty really so great these days? Educate me!

  11. It's much worse than that... by HotNeedleOfInquiry · · Score: 5, Insightful

    If a company is developing an embedded Linux ap for their own hardware. All of a sudden, all of the communications with the board-specific hardware is being done through binary drivers, resulting in an effectively closed system.

    No more hacking WRT54G's for you, chump.

    --
    "Eve of Destruction", it's not just for old hippies anymore...
  12. Re:As the article says, it's illegal, and a bad id by SWroclawski · · Score: 5, Insightful

    The BIOS is indeed an issue, and there are efforts underway to make a Free BIOS.

    But why not try our best to have as much control as we can?

  13. Re:This is the problem by aeoo · · Score: 5, Insightful

    Wrong. It is closed source companies who put the code before the user. They protect the code more than they protect the users. Open source is about protecting the user by allowing unhindered access to code for modification and redistribution.

    It's funny how you warp things around.

  14. and people defrauds it by diegocgteleline.es · · Score: 5, Informative

    Linux is actually much better at this than windows - you can see what the kernel does. Microsoft's test suite means nothing, as explained by a (great) microsoft programmer: http://blogs.msdn.com/oldnewthing/archive/2004/03/ 05/84469.aspx

    "In a comment to one of my earlier entries, someone mentioned a driver that bluescreened under normal conditions, but once you enabled the Driver Verifier (to try to catch the driver doing whatever bad thing it was doing), the problem went away. Another commenter bemoaned that WHQL certification didn't seem to improve the quality of the drivers.

    Video drivers will do anything to outdo their competition. Everybody knows that they cheat benchmarks, for example. I remember one driver that ran the DirectX "3D Tunnel" demonstration program extremely fast, demonstrating how totally awesome their video card is. Except that if you renamed TUNNEL.EXE to FUNNEL.EXE, it ran slow again.

    There was another one that checked if you were printing a specific string used by a popular benchmark program. If so, then it only drew the string a quarter of the time and merely returned without doing anything the other three quarters of the time. Bingo! Their benchmark numbers just quadrupled.

    Anyway, similar shenanigans are not unheard of when submitting a driver to WHQL for certification. Some unscrupulous drivers will detect that they are being run by WHQL and disable various features so they pass certification. Of course, they also run dog slow in the WHQL lab, but that's okay, because WHQL is interested in whether the driver contains any bugs, not whether the driver has the fastest triangle fill rate in the industry.

    The most common cheat I've seen is drivers which check for a secret "Enable Dubious Optimizations" switch in the registry or some other place external to the driver itself. They take the driver and put it in an installer which does not turn the switch on and submit it to WHQL. When WHQL runs the driver through all its tests, the driver is running in "safe but slow" mode and passes certification with flying colors.

    The vendor then takes that driver (now with the WHQL stamp of approval) and puts it inside an installer that enables the secret "Enable Dubious Optimizations" switch. Now the driver sees the switch enabled and performs all sorts of dubious optimizations, none of which were tested by WHQL.


    (IOW: it doesn't guarantee stability or quality at all. It's just a false sense of "stability")

  15. Re:out of touch linux kernel 'hackers' by ledow · · Score: 5, Informative

    First, I think you're missing the fact that, overall, Linux doesn't care that you can't put your binary-only drivers on it.

    Linus has said publically many times that the reason that there is not ABI is because he doesn't want one. Binary drivers for *anything* end up screwing stuff up. When they do, there is NOTHING anyone but the original author can do. The code stagnates, users get shut out without any help and nobody is any the wiser as to how that hardware actually worked in the first place.

    That's WHY there is stuff like the kernel module license tainting, so that the kernel developers look at a problem, see that you have the massive unknown of a in-kernel binary loaded and can instantly filter your report out. They don't care that your binary driver doesn't work. They can't help you.

    Additionally, setting anything into a static position means that development of it ends and stagnates. You'll never get a static interface that you can use to extend the drivers when new features come along. You end up with all sorts of kludges and interface versioning to try to take account of new things.

    Linux is developed as an independent operating system, not Windows 2006. No-one wants to make you use it if you don't want to. I doubt Linux was ever intended as anything other than a "pure", almost theoretical, system; that is, one that can be constantly redesigned from the ground up to the way it should have been, not kludged to make it fit your eight-year-old driver (which the author is no longer available to update) for a mouse that happens to still use the old interface.

    "Frankly, linux desperatly needs both a kernel debugger, and an ABI to be a REAL alternative for many customers."

    Whoa, magic word customers. Linux doesn't have customers. Your company may have customers. There's no obligation on Linux to help you get/keep your customers. People use Linux because they want to. How often does Linus appear on your telly begging you to buy into Linux? Never. Because he doesn't care if you do or not. However, I do imagine it feels pretty nice to him that you do want to use it.

    "It also needs the ABI for driver developers so that we can write a single driver and expect it to work on the dozens of flavors of linux we are expected to support."

    *You* are expected to support whatever you decide to make. Unfortunately, the linux kernel developers are expected to support YOU, your hardware and everyone else in the world. They don't because they cannot and have no reason to. Even if they had your complete source code, they cannot be expected to maintain your driver for you (which is what will happen when your company goes bust / gets bored with OS).

    Sometimes the best-written drivers in the world are not taken into the kernel because they don't quite fit and the maintainance involved in keeping them in the kernel is too difficult. Your driver, if it is to have any support in the kernel, needs to be able to be updated on any kernel-coder's whim in order to make the whole a better system. You can't do that with binaries, you can't even do it with stable interfaces. You have to have the source.

    The kernel coders have never promised that your stuff will always work (unless it is designed to run purely from userspace... several times Linus has says that userspace interfaces will not MUCH change over time.). They haven't because they cannot.

    The nature of the system is changes to bring improvements, from the interrupt system to the IDE interfaces, from the schedulers to the userspace interfaces such as sysfs or procfs, Linux changes and evolves over time and they cannot guarantee that anything other than userspace syscalls and the like will not be broken, changed or improved between one kernel release and the next.

    When the linux kernel people discover a new way to write drivers that sees enhancements across the board, chances are that they are going to break any of your "single driver" models. That's why they won't give you one. Them im