Hi,
Eventually, I want to implement IOCTL_SCSI_PASS_THOROUGH on Mac OS. The way I see it, there are two ways to do this:
1. Use the SCSITaskDevice interface. This is a CFPlugIn object provided by the driver (it's like a COM object). We have to get exclusive access (this requires all the handles to all device files to be closed, and the disk unmounted), and then we can send whatever SCSI commands we like.
Pros: No kernel code. Somewhat familiar paradigm to Windows programmers. Cons: Complicated usage. Needs every handle to device files closed.
2. Write an I/O Kit driver that exports the functionality we want. This way, we can get whatever we want that isn't exported to userspace by the current drivers. We could add this funcionality as a set of system IOCTLs.
Pros: Familiar paradigm to UNIX programmers. Fits in with the current FD-based code. We can implement other stuff, too (like drive locking). Cons: Kernel mode C++. Need I say more?
So each method has its pros and cons. I'd like to hear which one you guys prefer. If you don't know, that's OK. I personally don't like either of them, so if you have an alternative, I'll be glad to hear it... unless I have to tear it down as unfeasible. My current patch does it the first way (except for closing the server-side FD, which isn't implemented), but I'd really like some input before I proceed with it.
Thanks.
Chip