Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Confusion over drivers vs. driver interfaces



> This is true, but user land drivers aren't exactly
> Nirvana.
Relative to debugging a classic driver with USBProber printfs, they are
darn close. Probably also relative to anything kernel-mode on OS X.

> How do
> other applications, especially third-party apps, find
> your driver so that they can re-use what you've
> developed? All of Apple's examples of calling IOKit
> APIs from user-land are in the context of an
> application/tool.
I build my user-land "driver" as a Mach-O loadable bundle. It is not
used by third-parties, but is quite handy for several different apps and
plug-ins we have developed that use USB. We find the bundle through a
"registry" entry (an Application Support preference file) that is set up
by our installer. Our apps know where to look. The loadable bundle
approach allowed us to use the same API as our classic driver shim. The
result was a carbon app that could access our USB devices on 8, 9, and X
using the same API by simply loading the OS-applicable Shared Lib or
Bundle.

> Also, suppose you want your user-land driver to get
> loaded whenever a USB device gets plugged in, there's
> nothing in the OS that will do it automatically for
> you, i.e. there's no registry for user-land drivers.
It would be nice to have a standard registry for shims like this.

> Again, you'll have to write your own code to do this
> (I wound up having to write a small app that is a
> wrapper around my driver and that runs as a Startup
> Item).
I use a background app for auto-launching software on a USB plug. It was
a royal pain mainly because I needed three different builds for OS 8 (an
appe that can't check for multiple users) OS 9 (an appe that must check
for multiple users and delay auto-launch until login) and OS X (an APPL
that only gets launched on login).
The later is especially worrisome in that it depends on an undocumented
API and a request-only bit of sample code.
 
> Just some things to think about. It's in Apple's best
> interest to push for user-land drivers since they're
> not liable to destabilize the kernel in the same way
> that kernel-mode drivers can, and I'm not really
> critisizing the existing architecture, but I think
> Apple should consider doing more development to make
> life simpler from user-land. It sometimes seems like
> developing a user-land driver can be more work from a 
> developer's point of view.

I disagree, relative to my experience doing the same vendor-specific
driver on classic.
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Confusion over drivers vs. driver interfaces (From: Steve Ehrenfried <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.