Disc Error 20 appears to be a timing issue, which can be resolved with a patch. This is going to go into RISC OS 5 soon, so should resolve the issue going forward. For legacy OS a small ADFS patcher can be provided for loading early in the !Boot sequence.
Disc Error 21 is reproducible with SATA, but appears to be a side effect...see below. I've not produced it on any othe devices I've tested.
Disc Error 23 is remaining elusive, I've yet to get a device to trigger it, so have done no diagnosis. At the London Show the Iyonix did show it once on power up, but the machine is now dead so no testing there. Power cycling the machine resolved it, so it does sound timing related. If you have a device that reliably produces this error, please contact me.
SATA->IDE is a different issue. On power up, the IDE controller gets in a state initialising any SATA drive - as evident by the activity light being constantly on. Resetting the controller gets the drive working again and sending an Identify to the drive gets the correct response, however the MSB (top 8 bits of the 16 bit data transfer) is blank, so only half the data is transferred...every other byte is rubbish to be exact.
Without a logic analyser, it's impossible to tell if the MSB is on the bus, but my guess is that it will be as SATA appears to only support 16 bit transfers. All the SATA drives I've tested respond with Aborted if I attempt to force 8bit transfers and checking the drive spec sheets confirms this.
The ADFS data transfer code can be ruled out, as it correctly reads words from the IDE data port and writes them to memory, so the issue is possibly lower in the chain. One possibility is incorrect assertion of the -IOCS16 line as this does come into play when DMA isn't being used. IOMD doesn't support IDE DMA, so I can't test that, but this may explain why some SATA->IDE work on the Iyonix.
Fix Disc Error 20 and 23 on ADFS 2.67 / RISC OS 3.11 (abridged version for quick testing)
Code: Select all
*BASIC
*RMFaster ADFS
SYS "OS_Module",18,"ADFS" TO ,,,A%
A%?&24AC=1
A%!&2560=&E3A01801
Code: Select all
REM Live patch ADFS pre RiscPC for Disc Error 20 / 23
REM -------
REM Increases DRQ timeout (Disc Error 20 fix)
REM Caps large transfers to 1 sector (Disc Error 23 fix)
*RMKill ADFS
*RMReinit ADFS
*RMFaster ADFS
DIM temp% 16
P%=temp%
[OPT 2
MOV R1,#700
MOV R1,#65536
MOV R9,#&FF
]
C%=!temp%
D%=temp%!4
E%=temp%!8
SYS "OS_Module",18,"ADFS" TO ,,,adfs%
S%=!(adfs%-4)
FOR L%=0 TO S% STEP 4
Z%=adfs%!L%
IF Z%=C% THEN
adfs%!L%=D%
PRINT "DRQ timeout increased ("+STR$~L%+")"
ENDIF
IF Z%=E% THEN
adfs%?L%=1
PRINT "Transfers capped to 1 sector ("+STR$~L%+")"
ENDIF
NEXT
REM Remove next line to save the patched ADFS Module to RAM::0
END
OSCLI "SAVE ram::0.$.ADFS "+STR$~adfs%+"+"+STR$~S%
*SetType ram::0.$.ADFS Module
Code: Select all
REM Live patch ADFS RiscPC for Disc Error 20
REM -------
REM Increases DRQ timeout (Disc Error 20 fix)
*RMKill ADFS
*RMReinit ADFS
*RMFaster ADFS
DIM temp% 16
P%=temp%
[OPT 2
MOV R1,#700
MOV R1,#65536
]
C%=!temp%
D%=temp%!4
SYS "OS_Module",18,"ADFS" TO ,,,adfs%
S%=!(adfs%-4)
FOR L%=0 TO S% STEP 4
IF adfs%!L%=C% THEN
adfs%!L%=D%
PRINT "DRQ timeout increased ("+STR$~L%+")"
ENDIF
NEXT
REM Remove next line to save the patched ADFS Module to RAM::0
END
OSCLI "SAVE ram::0.$.ADFS "+STR$~adfs%+"+"+STR$~S%
*SetType ram::0.$.ADFS Module