site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Importance: Normal User-agent: SquirrelMail/1.4.5 Hi again Chris,
OS X does not support sending read/write commands except via the BSD layer (read/write/pread/pwrite/ioctl). Do you suspect that the drive is not accessing the media during a particular test you are running and therefore must use FUA?
I am in the process of creating an error correcting CD audio extractor for OS X. Part of the error-correcting algorithm is to read the same sector directly from the media several times and then compare the results. If the reads match, it is assumed to be good; if they don't, the drive speed is slowed, the sector is re-read and compared again, etc. Obviously if I read the sector once from disc and then the subsequent reads return identical data because of the drive's cache the scheme will fail. Unfortunately, this is exactly what happens using the DKIOCCDREAD ioctl. Hence the need to use FUA! I am aware of "hackish" ways around this such as reading data blocks larger than the drive's cache, but this is just that- a hack when nothing better is available. Plus, some drives have large caches! Stephen
-- Chris
On Jan 24, 2006, at 4:45 PM, me@sbooth.org wrote:
Chris,
I am familiar with the ioctls in IOCDMediaBSDClient (READ, READ TOC, etc).
I would like to use (primarily) the READ (10 or 12) command. I need to set the FUA bit- I don't believe this is possible with the DKIOCCDREAD ioctl.
Stephen --
What type of raw commands are you trying to send? Have you looked at the list of CD ioctls OS X supports?
-- Chris
On Jan 24, 2006, at 3:46 PM, me@sbooth.org wrote:
Hi Chris,
Thanks for the response!
You might want to start out with what you are trying to achieve. Are you trying to send commands from kernel-level code or user-level code?
Preferably user-level.
If the latter, you might want to check out the sample code found in / Developer/Examples/IOKit/scsi/SCSITaskLib and consult Accessing Hardware From Applications (http://developer.apple.com/ documentation/ DeviceDrivers/Conceptual/AccessingHardware/AH_Intro/ chapter_1_section_1.html).
I've read these now (thanks for the pointer), and also consulted the example code, but I'm still confused. The problem for me is that this all seems geared towards CD/DVD authoring and authoring-capable devices. For my application authoring doesn't matter. All I "need" to do is send a small subset of the MMC-2 commands to the drive to access an audio CD. I have had some success creating an MMCDeviceInterface, but that really doesn't help me because I can't obtain exclusive access from SCSITaskDeviceInterface. Even if I could, I'm not sure how that would help me because I really don't want to send raw SCSI tasks. I still don't understand enough about IOServiceGetMatchingServices to know which key to pass in to try and get an IOSCSIMultimediaCommandsDevice.
Stephen
HTH,
-- Chris
On Jan 24, 2006, at 2:30 PM, me@sbooth.org wrote:
I will start by saying the IOKit is pretty much a black box for me. I've done only basic tasks such as creating a dictionary and calling IOServiceGetMatchingServices for it. Unless I've missed something, the IOKit documentation is slightly less than stunning so I'm asking for help here.
I want to create an IOSCSIMultimediaCommandsDevice for accessing an audio CD using MMC-2 commands.
If I may rant for a moment, the superclass to IOSCSIMultimediaCommandsDevice is IOSCSIPrimaryCommandsDevice defined in "IOSCSIPrimaryCommandsDevice.h". I don't even have that header file in my 10.4u SDK! It's only in the 10.3.9 IOKit. To boot, that class' superclass is IOSCSIProtocolInterface which also appears only to exist in my 10.3.9 SDK.
Anyway, IOSCSIMultimediaCommandsDevice is a subclass of IOService. Can anyone step me through how I would go about obtaining an instance of this class?
Thanks! _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/sarcone% 40apple.com
This email sent to sarcone@apple.com
------------------ 6 Infinite Loop M/S 306-2MS Cupertino CA 95014 phone: (408) 974-4033 fax: (408) 862-7577 email: sarcone@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com