Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: target device creation problem in HBA driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: target device creation problem in HBA driver



Zhan --

    I'm writing a HBA driver now, and I'm a newbie on mac os driver. 

Welcome. Did you read the documentation available for Mac OS X HBA drivers yet? If not, here's a link:


    I returned true in DoesHBAPerformDeviceManagement(), and I called CreateTargetForID() in a thread. the first time I loaded my driver and it works, but when I unload it and then load the driver again, it does not work even the initcontroller() not called. Anything I missed?


Did your driver actually unload completely? What does 'kextstat' say?


And how to do the device management? Is there any sample codes?And is there any opensource HBA driver?


Unfortunately, we have not been able to open source a driver yet.


   I downloaded SCSIEmulater sample from apple website, and I was confused by it. It works good as a ramdisk, but when do the real hardware operation in ProcessParallelTask(), even just read a reg in a PCI I/O space, the OS crashed.Is there any other sample code or opensource driver?

It should be rather trivial. If you have your IOPCIDevice provider, you can simply make calls to config space or io space using the methods in IOPCIDevice. If you need memory-mapped addresses, you need to set them up using mapDeviceMemoryWithRegister() and then getting the base virtual address for that memory range with getVirtualAddress() on the IOMemoryMap object.

Make sure you also call setMemoryEnable(true) and setBusMasterEnable(true) on the IOPCIDevice so that your device is configured properly.


HTH,

-- Chris


------------------

6 Infinite Loop

M/S 306-2MS

Cupertino CA 95014

phone: (408) 974-4033

fax:   (408) 862-7577

email: email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Ata-scsi-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >target device creation problem in HBA driver (From: 舒展 <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.