Re: Controlling cd/dvd drive's cache
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com http://developer.apple.com/samplecode/SCSIOldAndNew/SCSIOldAndNew.html Am 13.01.2006 um 16:51 schrieb me@sbooth.org: Well, as I said, my knowledge of CD devices is becoming stale. I have always accessed drives on the very low level, i.e. sending SCSI or ATAPI commands to the drive. Maybe you should do the same Also, the cache size of 2048 sounds weird. A block of Red Book Audio has 2356 bytes, so it could not fit in there. On the level you are working on, I don't think I have any idea how to help. Sorry Alex Am 13.01.2006 um 16:19 schrieb me@sbooth.org: Alex (et al), Stephen I am not sure on which level you are looking. My time in CD-Recording is over for four years now - which is an eternity in IT. That said, I am sure the MMC3 command set has commands to do all these things. However, why would you need to do this? If you are writing to the device yourself, then you probably came across MMC command sets. Forcing the cache to be flushed when other applications are writing to the device is usually not a good idea. Alex Am 13.01.2006 um 16:05 schrieb me@sbooth.org: Hello all, Is there a way to control the hardware cache on cdrom drives in OS X? For example, I would like to turn caching on/off, force a flush of the cache, etc. It seems there should be an ioctl() to do this. But, all my searching has turned up nothing. What have I missed? _______________________________________________ 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/below%40mac.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... It looks like the READ (12) command has a bit in the header (FUA = Force Unit Access) that would do the trick. But now I am stumped on how to implement it. The IOKit is 90% of a mystery to me. All of my current code uses file descriptors and ioctls. I also have an io_object_t laying around that I used to extract the BSD path/file descriptor from. I believe I could use that to create an MMCDeviceInterface Can anyone provide/point me at some sample code on how to do this? P.S. Regarding the drive cache, I believe my drive has a 2048M cache for writing; I assume the same is used for reading. Thanks for the reply. What I am working on is adding "EAC-like" functionality (secure cd ripping) to my application (http://sbooth.org/Max/). In order to perform true error correction and verify that the audio data is correct, I need to compare multiple reads of the same sector. Obviously if erroneous data is in the cache then multiple reads of the same sector will always produce the same result. Hence the need to either 1) disable the cache or 2) read a block larger than the cache (2048 on my drive, too large for practical purposes) or 3) read a sector, flush the cache, re-read the sector, etc. So I am not writing a device driver per se, just performing some low-level manipulation. I had inquired about this a while back and never got a response, so thought I'd ask again. This email sent to below@mac.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Alexander von Below