Linked by Eugenia Loli-Queru on Sat 17th Sep 2005 01:08 UTC
BSD and Darwin derivatives Mac OS X provides a kernel extension mechanism as a means of allowing dynamic loading of pieces of code into the kernel, without the need to recompile. These pieces of code are known generically as plug-ins or, in the Darwin kernel, as kernel extensions or KEXTs.
Thread beginning with comment 32661
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: I'm not a big friend of these
by on Sat 17th Sep 2005 17:21 UTC in reply to "RE: I'm not a big friend of these"

Member since:

> The matching dictionary and plist stuff really is the easiest part of driver developement.

You really think so? I've done some OS X lately involving barcode readers, a heap of Linux stuff before (mostly low-level comm stuff, SPI, Ethernet & PHY, serial) and classic MacOS (mostly USB networking) and usually the hardware (given that you have specs or someone to ask) is usually understandable. Weird at times, but understandable. But when the IOKit docs say "this parameter is a matching directory for the iterator", I think "well, I want to match _my_ device, but what on earth do I have to put in there now". This is where the example browsing begins.

> For a driver newbie, it's much harder to actually know what you have to _do_ in a driver.
> I'd like an article "System agnostic driver programming for dummies" or the like.

It's rather simple. You tell the device what to do (on a basic scale). Then you wait for it to complete. You get the interrupt and post a second level interrupt. There, you deal with what to do next. Because you can't wait for all that in a thread, get used to state machines and basic sync primitives to feed them.

While all of the driver development can be _hard_, especially due to considerations beyond the basics, I've found Linux to be the most understandable platform (because in the end, you have to understand everything anyway, and the least abstractions you have to think around, the least overall overhead you have).

I know there are driver toolboxes for Windows that give you the illusion of easiness, but somewhere you'll miss a glitch hidden behind all that prettiness and then poor M$ (on _that_ record) gets all the BSOD-blame.

I guess we're seeing rather high quality drivers for the Mac much because of political issues, where the real cheapskate shops don't consider the Mac to be a viable platform. Mac-centric vendors generally have dedicated Mac coders and big shops can afford to keep a few of these, too (*). And then, maybe it's just _so_ complicated that by that fact the chaff gets weeded out anyway (**).

Rich

(*) Unfortunately I have seen a _very_ big south-eastish asian vendor employing guys with names that indicate they're from a popular outsourcing (_very_ large south asian) country. They've been posting on a certain list regarding IOKit/kext issues - and they positively hadn't got _ANY_ clue on what all this stuff was about.

(**) One quirk on the classic Mac, for example, is that OpenTransport will pretty much re-enter and post callbacks at _any_ time - you get to figure this out the hard way and if you're not able to understand that and put it in context with your project, you will not get a driver that works for more than 5 minutes.

Reply Parent Bookmark Score: 1