View Single Post
Old 13 January 2015, 20:58   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
SCSI emulation issues (maybe)

I've been trying to get a config with HDF on Fastlane Z3 to boot, unsuccessfully so far. It's an A3000-like config with bootable uaehf HDF. For testing the HDF connected to the Fastlane just contains all zero bytes.

Running WinUAE (3.1.0b3) with -scsiemulog, emulation seems to get stuck after a small amount of SCSI commands. The last few SCSI lines in the log are:

SCSIEMU HD 0: 28.00.00.00.00.0F.00.00.01.00.00.00 CMDLEN=10 DATA=07491C50
-> DATAOUT=512 ST=0 SENSELEN=0 REPLYLEN=0
SCSIEMU HD 0: 00.20.00.00.00.00.00.00.01.00.00.00 CMDLEN=6 DATA=07491C50
UAEHF: unsupported scsi command 0x00 LUN=1
-> SENSE STATUS: KEY=5 ASC=24 ASCQ=00
70.00.05.00.00.00.00.00.00.00.00.00.24.00.00.00.00.00.
SCSIEMU HD 0: 12.20.00.00.FE.00.00.00.01.00.00.00 CMDLEN=6 DATA=07491C50
-> DATAOUT=36 ST=0 SENSELEN=0 REPLYLEN=36
REPLY: 7F.00.01.00.20.00.00.20.55.41.45.20.20.20.20.20.74.65.73.74.5F.34.47.42.2E.62.69.6E.20.20.20.20.30.2E.34.20.

So as far as I can tell, that means:
LUN 0, READ(10) of 1 sector, LBA 0x0F. [Fastlane ROM reading the last of the sectors where the RDB can be.]

LUN 1, TEST UNIT READY.
WinUAE emulates response from drive of sense key=5, asc=24 ascq=0
70.00.05.00.00.00.00.00.00.00.00.00.24.00.00.00.00.00.

70 is CHECK CONDITION, but the first byte is wrong I think. The valid bit (bit 7) should be 1, according to the SCSI-2 spec (s2-r10l.pdf page 159): "A valid bit of zero indicates that the information field is not as defined in this International Standard. A valid bit of one indicates the information field contains valid information as defined in this International Standard. Targets shall implement the valid bit."
So that should be F0 instead of 70.

05/24 = ILLEGAL REQUEST/INVALID FIELD IN CDB
I don't think that's the best response. Page 172 of s2-r10l.pdf lists preferred TEST UNIT READY responses. The most suitable in this case (LUN not present) would be ILLEGAL REQUEST/LOGICAL UNIT NOT SUPPORTED (05/25).


Also, the INQUIRY data looks like:
7F - peripheral qualifier/peripheral device type. 0x7F = "logical unit not present"
00 - RMB/device-type modifier
01 - ISO version=0, ECMA version=0, ANSI-approved version=1 "the device complies to ANSI X3.131-1986 (SCSI-1)"
00 - AENC/TrmIOP/Reserved/Response data format
20 - additional length (n-4)
00 - reserved
00 - reserved
20 - WBus16 bit set

Would it be better to put 02 for the third byte, to indicate compliance with SCSI-2? In the 8th byte the WBus16 bit is set. Was wide SCSI only supported with SCSI-2 and later? Pretty much the whole INQUIRY response is considered vendor-specific in SCSI-1.

I'm hoping a fix for these will solve the problems I had booting HDFs on GVP and Fastlane controllers. HDFs which have the "last LUN" bit set in the RDB probably aren't affected, since the ROM should never issue any commands to LUN 1 in that case.

Last edited by mark_k; 13 January 2015 at 21:14.
mark_k is offline  
AdSense AdSense  
 
Page generated in 0.07845 seconds with 9 queries