Date : Wed, 15 Dec 2004 00:21:19 +0000
From : jgh@... (Jonathan Graham Harston)
Subject: Re: Debugging ADFS and IDE drives
Yes! YES! *YES!* <fx: pulls clenched fist down, lifting knee slightly>
It works!
I've fixed it by doing each sector access twice, by adding the
following code:
> .CommandStart :\ C=R/W, &B0/1=>block
> JSR SetGeometry :\ Set shape to cylinder*4*64
> .CommandLoop
LDX #2:.Twice :\ Bypass DRQ bug
> JSR SetSector:LDY #0 :\ Set sector, count, command
> JSR WaitForData:AND #&21:BNE TransError
> .TransferLoop
> BIT &CD:BVS TransTube:BCC IORead
> .IOWrite :LDA (&80),Y:STA &FC40:BRA TransferByte
> .IORead :LDA &FC40:STA (&80),Y:BRA TransferByte
> .TransTube:BCC TubeRead
> .TubeWrite:LDA &FEE5:STA &FC40:BRA TransferByte
> .TubeRead :LDA &FC40:STA &FEE5:BRA TransferByte
> :
> .TransferByte
> INY:BNE TransferLoop :\ Loop for 256 bytes
DEX:BNE Twice:INC &81 :\ Bypass DRQ bug
> LDA &FC47:AND #&21:BNE TransError:\ Error occured
> INC &87:BNE TransCount :\ Increment sector
> INC &86:BNE TransCount:INC &85
> .TransCount
> DEC &88:BNE CommandLoop :\ Loop for all sectors
Wah hey!!!!!!!!!
I'm now just waiting for the parts to arrive from Farnell and
I'll assemble some cards. To those interested, it's looking
like about `50-`60 or so for assembled card plus 80M drive
(formatted to 40M) and new ADFS ROM and leads to plug into
1MHz bus and AUX-PWR.
Before I blow some EPROMs, there's a final bit of tidying up
to do. The Master Reference Manual gives a list of result
codes from the SCSI disk access call, on pJ11-13. However,
the IDE interface can give more results than the list shown.
Can anybody enlighten me as what I should translate Media
Changed, Media Change Request and Drive Empty into?
IDE Description SCSI Description
&x0xx OK &00 OK
&2xxx Device Fault &65 Bad drive
&x140 Data Error &48 CRC error
&x120 Media Changed
&x110 Sector not found &50 Sector not found
&x108 Media Change Request
&x104 Command not supported &60 Bad command
&x102 Drive empty
&61 Bad address
&63 Volume error
--
J.G.Harston - jgh@... - mdfs.net/User/JGH
Badly formed email is deleted unseen as spam
--
___ ___ ___ ___ ___ ___ | Free BBS, Fax, E-mail and Usenet News |
| / \/ \/ \/ \/ \/ \ | +44 20 8654 2212 Fidonet#2:254/27.0 |
| A R C A D E | Web/FTP/Telnet: arcade.demon.co.uk |
| The Definitive ACORN/RISC OS BBS | Demon Express Solo ADSL in Croydon UK |