View Single Post
Old 01 January 2017, 12:05   #1
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,507
IDE emu: corrupted inquiry data after CMD_READ more than 16 sectors

If I do a CMD_READ from IDE scsi.device with more than 16 sectors (8 KB) at once, a subsequent HD_SCSICMD with INQUIRY or READ CAPACITY returns completely corrupted data. And a following CMD_READ crashes the Amiga.

This started in 3.2.0, 3.1.0 is ok. And of course it does not happen on a real Amiga.

To reproduce use the attached test program:

- select a4000 quickstart
- add test.lha as boot drive
- add just any HDF or VHD to IDE:0
- set serial port to tcp::1234/wait
- start
- run telnet localhost 1234 in a DOS window.

- at the AmigaDOS prompt enter

test_ser scsi.device 0 cache 16

to see a successful test and enter

test_ser scsi.device 0 cache 17

or any other number higher than 16 to see the problem.

(test_con writes to the CLI window, test_ser uses kprintf to write to the serial port, otherwise they are identical)

If you are lucky and the emulated Amiga does not crash, you can "repair" it by running the test again with 16 sectors.

Example output:
Code:
begin of test
try 1 of 2
do_scsi_cmd: Actual      = 36
do_scsi_cmd: CmdActual   = 6
do_scsi_cmd: SenseActual = 0
scsi_inquiry: Vendor   = <UAE-IDE >
scsi_inquiry: Product  = <wb31.vhd        >
scsi_inquiry: Revision = <0.7 >
do_scsi_cmd: Actual      = 8
do_scsi_cmd: CmdActual   = 10
do_scsi_cmd: SenseActual = 0
scsi_capacity: BlockAddress = 2047751
scsi_capacity: BlockLength  = 512
cache size = 17 * 512 = 8704
cmd_read: offset = 0; length = 8704; data = 78791AC
0: <    >
1: <    >
2: <RDSK>
3: <PART>
4: <PART>
5: <PART>
6: <FSHD>
7: <LSEG>
try 2 of 2
do_scsi_cmd: Actual      = 36
do_scsi_cmd: CmdActual   = 6
do_scsi_cmd: SenseActual = 0
scsi_inquiry: Vendor   = gl,(   >
scsi_inquiry: Product  = <>■R"            >
scsi_inquiry: Revision = <g@">
do_scsi_cmd: Actual      = 8
do_scsi_cmd: CmdActual   = 10
do_scsi_cmd: SenseActual = 0
scsi_capacity: BlockAddress = 4294967295
scsi_capacity: BlockLength  = 512
cache size = 17 * 512 = 8704
cmd_read: offset = 0; length = 8704; data = 78791AC
Attached Files
File Type: lha test.lha (6.1 KB, 17 views)
thomas is offline  
AdSense AdSense  
 
Page generated in 0.08610 seconds with 10 queries