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: sample driver code ?



> As far as my programming background goes, I've done a bit of C coding
> and a very minor amount of device driver work with the Linux kernel. I
> got some of Apple's documentation about Objective C and their notes on
> their IO Kit and kernel programming.

First : You can do your driver in C , nowhere is stated that is has to
be in Objective C. What you have to use, and to follow, is the
corresponding Framework. Probably something that starts with
IO(Kit,KitLib).

Second (this is true) : Try it in userland first. Then you can use gdb
while debugging and the kernel crash rate goes to 0.

> What really helps me is looking at something that has traits similar to
> my final goal, and modifying and optimizing as I go along. The card I
In the code samples you'll at leats find a blank driver sample for the
PCMCIA (I did not look, but there are some for almost all plugs and
slots a Mac has).

Then take the blank sample and first try to match your interface. Once
you found it look at the way the initial communication is doen. In USB
this is e.g. getting the interface discriptor. This is one of the
framework calls. In that framework you should also find the other
communication calls that are needed for your plug to the outside world.

Then go on with the driver docs of your device to talk to it.
--
Hado Hein, Berlin, Fed.Rep. of Germany

http://HadoH.bei.t-online.de (stage lighting profession)
http://www.batchmaker.de (software authoring, including stage lighting)
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.



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.