Re: Generic Kernel API

From: Charles Swiger (cswiger_at_mac.com)
Date: 11/09/05

  • Next message: Charles Swiger: "Re: Generic Kernel API"
    Date: Wed, 9 Nov 2005 16:23:28 -0500
    To: Julian Elischer <julian@elischer.org>
    
    

    On Nov 9, 2005, at 1:58 PM, Julian Elischer wrote:
    > Marcin Jessa wrote:
    [ ... ]
    >> My idea is to create an API for binary vendor drivers to make it
    >> easier for hardware vendors to create FreeBSD drivers the same way
    >> they can do for Windows or Mac OS X.
    >
    > well, you could port the Darwin driver interface in the form of a
    > shim, or
    > extend "project evil" to cover more kinds of drivers..

    An interesting thought, although the IOKit uses an embedded C++
    subset rather than plain C [1]. For those who aren't familiar with
    it, the Darwin kernel API for drivers, variously called the IOKit or
    DriverKit, is documented here:

    http://developer.apple.com/documentation/DeviceDrivers/

    ...and the "Fundamentals" document is an interesting read:

    "First, neither the Mac OS 9 driver model nor the FreeBSD driver
    model offers a set of features rich enough to meet the needs of Mac
    OS X. The Mac OS X kernel is significantly more advanced than its Mac
    OS precursors; it handles memory protection, preemptive multitasking,
    multiprocessing, and other features not present in previous versions
    of Mac OS. Although FreeBSD is capable of handling these features,
    the BSD model does not offer other features expected in a modern
    operating system, including automatic configuration, driver stacking,
    power management, and dynamic loading of devices."

    In truth, FreeBSD does have reasonable support for PnP autoconfig and
    dynamic loading of device drivers, and FreeBSD does have a decent C-
    based object system with introspection in <sys/kobj.h>, although that
    doesn't seem to be fully taken advantage of in places where it could
    be, except perhaps in the sound and UART drivers. Most other FreeBSD
    drivers are "flat" and have a fair amount of code duplication, rather
    than using OO inheritance so that your fxp or dc driver inherits from
    a common NIC abstraction (Apple's IONetworkController ->
    IOEthernetController -> _device_).

    Apple has found that using inheritance is a big win for them: "In
    addition, code reusability decreases the memory footprint of drivers;
    drivers ported from Mac OS 9, for example, have been up to 75%
    smaller in Mac OS X." Of course, it's easier to say such things then
    to write the code, but Apple has achieved pretty good results from
    the IOKit.

    -- 
    -Chuck
    [1]: http://www.caravan.net/ec2plus/
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Charles Swiger: "Re: Generic Kernel API"

    Relevant Pages

    • >>>>>> MAC DRIVERS <<<<<<
      ... lexmark mac printer drivers ... canon mp600 drivers for mac osx ... dell printer drivers for mac ...
      (sci.mech.fluids)
    • Re: This is Huge! MacBook Hacked!!
      ... on Maynor and Ellch pretty hard not to make this an issue about the Mac ... drivers -- mainly because Apple had not fixed the problem yet. ... I stand by my own reporting, as according to Maynor and Ellch it remains ...
      (comp.sys.mac.advocacy)
    • Re: Policy for removing working code (Was: HEADS UP: FreeBSD 6.4 and 8.0 EoLs coming soon)
      ... I understand that we need to support modern fast hardware but that doesn't mean ... we should drop working features for that. ... drivers need to be made to run Giant-free so that FreeBSD can drop Giant ...
      (freebsd-stable)
    • Re: Apple is Impatient
      ... We've seen it before with the transition to Mac OS X. ... We would keep our drivers up to date to work with the beta releases. ... to Intel CPUs ...
      (comp.sys.mac.advocacy)
    • Re: This is Huge! MacBook Hacked!!
      ... a Mac uses a Apple wireless card, ... but Apple's wireless device drivers are just as exploitable ...
      (comp.sys.mac.advocacy)