1

Windows 7
C 编程
Visual C++ 2008(在 VMWare 中)

我想用DeviceIOControl 向 USB 硬盘驱动器发送一些 ATA 命令(IDENTIFY DEVICE、READ NATIVE MAX ADDRESS、SET MAX ADDRESS)。因此我有一些问题。

据我了解,USBSTOR 无法直接处理 ATA 命令(使用IOCTL_ATA_PASS_THROUGH)。我试过这个,它适用于本机 IDE 硬盘,但不适用于 USB。

  1. 应用程序将 SCSI 命令发送到设备并将它们转发到设备是否正确?所以我需要创建一个封装了相应 ATA 命令的 SCSI 命令?

  2. dwIoControlCode能用什么来做到这一点?我试过了,IOCTL_SCSI_MINIPORT但错误是ERROR_NOT_SUPPORTED. 它可以与 minport 一起使用吗?微型端口是否仍然是最新的?

4

1 回答 1

1

Look at this link:

http://www.mombu.com/microsoft/windows-programmer-nt-kernel-mode/t-howto-send-ata-spec-command-to-usb-hdd-1646752.html

Q: howto send ATA spec. command to USB HDD?

A: You are limited to whatever the USB->ATA tailgate (bridge) chip supports. If you control the bridge, you can implement whatever you want. If you don't, you'll have to ask the bridge vendor to reveal what they do support. See my replies in the thread on 1394->ATA on NTDEV for more information.

Q: Once more question: whether probably to get access to everyone disk in SCSI RAID?

A: No.

You can only send SCSI commands to the bridge/enclosure at the end of the USB cable. How they are translated to ATA commands - is not under your control.

I assume El Cheapo enclosures to only translate the essential SCSI commands. In this case, you will only have 1) SCSI INQUIRY emulated by ATA IDENTIFY 2) SCSI READ CAPACITY emulated by ATA IDENTIFY 2) READ and WRITE 3) VERIFY.

And that's all. In this case, you will have zero chances sending any non-trivial ATA commands, since the USB-to-ATA bridge on other side provides no ways of doing such.

于 2013-01-12T18:50:12.567 回答