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: PCIATA driver matching



Hi Larry.

On Monday, December 23, 2002, at 07:00 PM, Larry Barras wrote:
Hi Ernesto,

It's probably easiest to just let IOKit do your matching and starting for you. You are on the right track with implementing your driver stack. Most PCI-ATA controller chips implement 2 ATA controllers in the chip. So the driver structure is like you created, you need some sort of driver to match the chip, do any necessary initialization, then create nubs for each bus present in the chip. At Apple, I call this the "Root" driver, so it would be called AppleXYZRoot.kext. This is usually derived from IOService and matches by name the "pci-xyz,abc" device and vendor property.

When the root driver loads it initializes the chip, extends the interrupt tree and then creates the nubs for each bus and copies down any properties needed, like addresses, interrupt numbers, bus ID and stuff. Then it calls nub->registerService() to invoke IOKit's matching. Usually, that's all it needs to do. The "nubs" are just that, attachment points and don't generally have much functional code in them.

IOKit will then look for a kext that has the necessary properties to match the nubs just registered. That should be the ones derived from IOATAController (or in your case, IOPCIATA, which in turn derives from IOATAController). At Apple, I always call this the "ATA" driver, so it would be AppleXYZATA.kext.

Your "root" driver shouldn't need to create any instances of your "ata" driver. Let IOKit do that for you.

I see where you're going with this. Basically that's how the CMD646 driver works. However, I notice it tries to match on a 'ata-4' property, and for the life of me I can't seem to find where you set that property on the Root driver.

Thanks for the heads up.

Ernesto.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: PCIATA driver matching (From: Larry Barras <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.