实际硬件上的MassStorage

时间:2018-09-21 21:40:44

标签: usb scsi

我正在使用(在实际硬件上)EHCI和UHCI驱动程序,并且还具有适用的Mouse,Hub和Keyboard驱动程序。现在,我正在编写MassStorage驱动程序。在QEMU和BOCHS上一切正常(BOCHS调试输出将在下面),但是在实际硬件上,我的驱动程序首先在端点上的“清除暂停功能”上失败。因此,我试图在端点上“清除暂停”,但是我的控制器在QH令牌中设置了“暂停”位。接下来,我将使用命令“开始停止单元”发送CBW,创建TD来读取CSW,并且设备尚未完成请求(我正在等待完成,但从未成功)。

因此,调试BOCHS的输出:

02862800000d[USBMSD] MASS STORAGE RESET:
02863200000d[USBMSD] USB_REQ_CLEAR_FEATURE:
02863600000d[USBMSD] USB_REQ_CLEAR_FEATURE:
02864000000d[USBMSD] MASS STORAGE: GET MAX LUN
02864400000d[USBMSD] packet hexdump (31 bytes)
02864400000d[USBMSD] 55 53 42 43 00 10 00 00 00 00 00 00 00 00 0A 00
02864400000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02864400000d[USBMSD] command on LUN 0
02864400000d[USBMSD] command tag 0x1000 flags 00000000 len 10 data 0
02864400000d[SCSIHD] command: lun=0 tag=0x1000 data=0x00
02864400000d[SCSIHD] Test Unit Ready
02864400000d[SCSIHD] command complete tag=0x1000 status=0 sense=0
02864400000d[USBMSD] command complete 0
02864800000d[USBMSD] command status 0 tag 0x1000, len 13
02864800000d[USBMSD] packet hexdump (13 bytes)
02864800000d[USBMSD] 55 53 42 53 00 10 00 00 00 00 00 00 00
02865200000d[USBMSD] packet hexdump (31 bytes)
02865200000d[USBMSD] 55 53 42 43 00 00 01 00 24 00 00 00 80 00 0A 12
02865200000d[USBMSD] 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00
02865200000d[USBMSD] command on LUN 0
02865200000d[USBMSD] command tag 0x10000 flags 00000080 len 10 data 36
02865200000d[SCSIHD] command: lun=0 tag=0x10000 data=0x12
02865200000d[SCSIHD] inquiry (len 36)
02865200000d[SCSIHD] read buf_len=36
02865600000d[USBMSD] data in 36/36
02865600000d[SCSIHD] read sector_count=0
02865600000d[SCSIHD] command complete tag=0x10000 status=0 sense=0
02865600000d[USBMSD] command complete 0
02865600000d[USBMSD] packet hexdump (36 bytes)
02865600000d[USBMSD] 00 00 03 02 1F 00 00 10 42 4F 43 48 53 20 20 00
02865600000d[USBMSD] 42 4F 43 48 53 20 48 41 52 44 44 49 53 4B 20 00
02865600000d[USBMSD] 31 2E 30 00
02866000000d[USBMSD] command status 0 tag 0x10000, len 13
02866000000d[USBMSD] packet hexdump (13 bytes)
02866000000d[USBMSD] 55 53 42 53 00 00 01 00 00 00 00 00 00
02866400000d[USBMSD] packet hexdump (31 bytes)
02866400000d[USBMSD] 55 53 42 43 00 00 00 00 08 00 00 00 80 00 0A 25
02866400000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02866400000d[USBMSD] command on LUN 0
02866400000d[USBMSD] command tag 0x0 flags 00000080 len 10 data 8
02866400000d[SCSIHD] command: lun=0 tag=0x0 data=0x25
02866400000d[SCSIHD] Read Capacity
02866400000d[SCSIHD] read buf_len=8
02866800000d[USBMSD] data in 8/8
02866800000d[SCSIHD] read sector_count=0
02866800000d[SCSIHD] command complete tag=0x0 status=0 sense=0
02866800000d[USBMSD] command complete 0
02866800000d[USBMSD] packet hexdump (8 bytes)
02866800000d[USBMSD] 00 02 30 03 00 00 02 00
02867200000d[USBMSD] command status 0 tag 0x0, len 13
02867200000d[USBMSD] packet hexdump (13 bytes)
02867200000d[USBMSD] 55 53 42 53 00 00 00 00 00 00 00 00 00
02867600000d[USBMSD] packet hexdump (31 bytes)
02867600000d[USBMSD] 55 53 42 43 10 00 01 00 00 04 00 00 80 00 0A 28
02867600000d[USBMSD] 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
02867600000d[USBMSD] command on LUN 0
02867600000d[USBMSD] command tag 0x10010 flags 00000080 len 10 data 1024
02867600000d[SCSIHD] command: lun=0 tag=0x10010 data=0x28
02867600000d[SCSIHD] Read (sector 0, count 2)
02867600000d[SCSIHD] read sector_count=2
02868000000d[USBMSD] data in 512/1024
02868000000d[USBMSD] deferring packet 0BA31020
02871199600d[SCSIHD] data ready tag=0x10010 len=1024
02871199600d[USBMSD] packet hexdump (512 bytes)
02871199600d[USBMSD] EB 58 90 4D 53 44 4F 53 35 2E 30 00 02 01 BE 17
02871199600d[USBMSD] 02 00 00 00 00 F8 00 00 3F 00 20 00 01 00 00 00
02871199600d[USBMSD] 04 30 02 00 21 04 00 00 00 00 00 00 02 00 00 00
02871199600d[USBMSD] 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 80 01 29 AA 12 8D C8 4E 4F 20 4E 41 4D 45 20 20
02871199600d[USBMSD] 20 20 46 41 54 33 32 20 20 20 FC B8 00 90 8E C0
02871199600d[USBMSD] 2D 80 00 8E D0 BC 00 08 B9 00 01 BE 00 7C 31 FF
02871199600d[USBMSD] 8E DF F3 A5 06 6A 78 CB 0E 1F 88 16 40 00 80 26
02871199600d[USBMSD] 2F 00 0F 66 8B 36 2C 00 6A 60 07 31 DB E8 50 00
02871199600d[USBMSD] 66 56 9C 6A 60 07 31 FF BE F3 01 A0 0D 00 98 F7
02871199600d[USBMSD] 26 0B 00 C1 E8 05 89 C2 B9 0B 00 26 38 2D 75 03
02871199600d[USBMSD] E9 CB 00 60 F3 A6 61 74 0E 83 C7 20 4A 75 EC 9D
02871199600d[USBMSD] 66 5E 72 C4 E9 B7 00 26 FF 75 14 26 FF 75 1A 66
02871199600d[USBMSD] 5E 6A 60 07 31 DB E8 07 00 72 FB EA 00 06 00 00
02871199600d[USBMSD] A1 0B 00 C1 E8 02 66 98 66 89 F5 66 96 66 99 66
02871199600d[USBMSD] F7 F6 66 0F B7 3E 0E 00 66 01 F8 52 B9 01 00 E8
02871199600d[USBMSD] 49 00 5E 01 F6 01 F6 26 80 64 03 0F 26 66 8B 34
02871199600d[USBMSD] 66 67 8D 45 FE 66 0F B6 0E 0D 00 66 F7 E1 66 89
02871199600d[USBMSD] C5 66 0F B6 06 10 00 66 F7 26 24 00 66 01 E8 66
02871199600d[USBMSD] 01 F8 E8 16 00 A1 0B 00 C1 E8 04 F7 E1 8C C1 01
02871199600d[USBMSD] C1 8E C1 66 81 FE F8 FF FF 0F C3 66 60 60 6A 00
02871199600d[USBMSD] 6A 00 66 50 06 53 6A 01 6A 10 B4 42 8A 16 40 00
02871199600d[USBMSD] 89 E6 16 1F CD 13 0E 1F 72 14 83 C4 10 61 49 74
02871199600d[USBMSD] 0A 03 1E 0B 00 66 83 C0 01 EB D2 66 61 C3 B8 45
02871199600d[USBMSD] 0E CD 10 EB FE 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871199600d[USBMSD] 00 00 00 53 54 41 52 54 55 50 20 20 20 20 55 AA
02871199600d[USBMSD] packet complete 0BA31020
02871600000d[USBMSD] data in 512/512
02871600000d[SCSIHD] read sector_count=0
02871600000d[SCSIHD] command complete tag=0x10010 status=0 sense=0
02871600000d[USBMSD] command complete 0
02871600000d[USBMSD] packet hexdump (512 bytes)
02871600000d[USBMSD] 52 52 61 41 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02871600000d[USBMSD] 00 00 00 00 72 72 41 61 87 0F 02 00 10 01 00 00
02871600000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA
02872000000d[USBMSD] command status 0 tag 0x10010, len 13
02872000000d[USBMSD] packet hexdump (13 bytes)
02872000000d[USBMSD] 55 53 42 53 10 00 01 00 00 00 00 00 00
02872400000d[USBMSD] packet hexdump (31 bytes)
02872400000d[USBMSD] 55 53 42 43 10 00 01 00 00 02 00 00 80 00 0A 28
02872400000d[USBMSD] 00 00 00 00 01 00 00 01 00 00 00 00 00 00 00
02872400000d[USBMSD] command on LUN 0
02872400000d[USBMSD] command tag 0x10010 flags 00000080 len 10 data 512
02872400000d[SCSIHD] command: lun=0 tag=0x10010 data=0x28
02872400000d[SCSIHD] Read (sector 1, count 1)
02872400000d[SCSIHD] read sector_count=1
02872800000d[USBMSD] data in 512/512
02872800000d[USBMSD] deferring packet 0BA311A0
02874000000d[SCSIHD] data ready tag=0x10010 len=512
02874000000d[USBMSD] packet hexdump (512 bytes)
02874000000d[USBMSD] 52 52 61 41 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02874000000d[USBMSD] 00 00 00 00 72 72 41 61 87 0F 02 00 10 01 00 00
02874000000d[USBMSD] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA
02874000000d[SCSIHD] read sector_count=0
02874000000d[SCSIHD] command complete tag=0x10010 status=0 sense=0
02874000000d[USBMSD] command complete 0
02874000000d[USBMSD] packet complete 0BA311A0
02874800000d[USBMSD] command status 0 tag 0x10010, len 13
02874800000d[USBMSD] packet hexdump (13 bytes)
02874800000d[USBMSD] 55 53 42 53 10 00 01 00 00 00 00 00 00

所以,正如您所看到的,我做的还不错,但是真正的硬件却不这么认为。

0 个答案:

没有答案