Disc Error 20/21/23 and SATA->IDE support

discuss the archimedes & risc pc, peripherals and risc os/risc os on pi
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by sirbod »

danielj wrote:Can we not just use ADFS from 3.19 and patch that?
It's versioned 2.68 and ADFSUtils isn't present, so yes it should be possible.

EDIT: A pre-patched version is attached to the OP
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by sirbod »

I've had a quick look at ADFSUtils from RISC OS 3.11. Its a specific patcher for ADFS 2.67 in RISC OS 3.11 and as Jeffrey has pointed out, will only patch ADFS if its the ROM version as it checks for the Module being at a specific address.

It hijacks the floppy interrupt device (device 12) and passes the interrupts onto ADFS in all cases, except when there's one specific value in one of ADFS's workspace values. The bug introduced in ADFS 2.67 that was patched by ADFSUtils was a lock that could occur when accessing floppies when ADFSBuffers<8, so very likely a buffer overrun bug.

There's no equivalent patcher pre RISC OS 3.10 and I'm not certain if a version of ADFSUtils was released for RISC OS 3.10. The issue pre RISC OS 3.10 that was fixed in ADFS 2.67 was a FileCore in use error occurring if floppies were removed before being dismounted when ADFSBuffers>0.

In short ADFSBuffers is an issue if you're using floppies pre RISC OS 3.11 and ADFSUtils will only live patch ADFS 2.67 in the RISC OS 3.11 ROM. There is however another bug that was introduced in RISC OS 3.0 on the A5000, which causes HD corruption if ADFSBuffer>0.

This highlights an issue with ADFFS, as it doesn't RMReInit ADFSUtils, after it's RMReInit'd ADFS, meaning the ADFSBuffers bug is probably being re-introduced when ADFFS is loaded on RISC OS 3.11. I'd best get that fixed for the next release :oops:
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by danielj »

=D>
Really great work on this Jon :) It will also bring down the price of 8-bit IDE minipodules :D

Is "re-rolling" the OS for burning onto new ROMs fairly straightforward? It looks like it needs to go onto 27c800s (I think the Amiga community use these reasonably frequently, and they seem to be reasonably available).

d.
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by sirbod »

danielj wrote:=D>
Really great work on this Jon :) It will also bring down the price of 8-bit IDE minipodules :D
If there's one thing that gets my goat up, it's profiteering on the need for 3rd party IDE modules and mouse/keyboard adapters! This is really my main drive behind resolving these issues. On the keyboard/mouse adapter front, I have designed boards based on other designs and purchased bulk parts to make them, I just haven't had the time to test the design or look into possible SMD manufacturing instead. I could really use someone to come on board with me to get that moving.
danielj wrote: Is "re-rolling" the OS for burning onto new ROMs fairly straightforward? It looks like it needs to go onto 27c800s (I think the Amiga community use these reasonably frequently, and they seem to be reasonably available).
Spooky, I've been up since 5am compiling a post on just this very subject.
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by sirbod »

Can I assume from the one person that's downloaded the pre-patched ADFS268, that all the SD/CF compatibility issues pre RiscPC are now resolved?

Can I also presume that Disc Error 23 does not occur on A7000/RiscPC, meaning all the compatibility issues are resolved by Jeffrey's beta ROMpatch, or the patcher in the OP? Jeffrey's updated ROMpatch should be used in preference, as it hangs off TickerV instead of stalling the CPU.

As Jeffrey has also pointed out, the Disc Error 20 fix has now gone into RISC OS 5, so A7000/RiscPC/Iyonix running the latest nightly build should have no compatibility issues.

All of which just leaves Disc Error 21 to resolve? ie specifically SATA->IDE adapters and any SD adapter or CF that doesn't control -IOCS16. This will entail a hardware solution, the details of which have yet to be worked out.
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by danielj »

Let me run some tests on my a3020 over the weekend. I believe that's not listening to the line...

d.
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by sirbod »

I've attached an updated ADFS 2.68 as the previous version was missing all of its * commands.
User avatar
lcww1
Posts: 306
Joined: Wed Mar 15, 2017 11:16 pm
Location: Cloud Cuckoo Land
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by lcww1 »

This is really fantastic news - I’ll be very glad to test out the updated ADFS over the weekend - and many thanks for all your work on RO3.11, it’s much appreciated
User avatar
lcww1
Posts: 306
Joined: Wed Mar 15, 2017 11:16 pm
Location: Cloud Cuckoo Land
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by lcww1 »

sirbod wrote:Can I assume from the one person that's downloaded the pre-patched ADFS268, that all the SD/CF compatibility issues pre RiscPC are now resolved?
I've tested ADFS268 on my A3020 this evening - I can confirm that this modified ADFS is working nicely with all the CF cards that I've got, including some *inexpensive* fleabay 512Mb Cisco CF cards that I could never previously get to work on any RISC OS system. I've also tested the following CF cards in the A3020 with ADFS268: a pair of Sandisk 512Mb cards, a Lexar Platinum 40x 512Mb, and a Transcend 80x 512Mb - all working, though my tests have not been exhaustive. In the case of the Cisco, and Transcend cards, these previously failed with Disc error 23, but ADFS268 has fixed this problem.

With ADFS268, the A3020 has been happily running two CF cards, both attached to the internal IDE connector, as master and slave, in a dual CF card to IDE adapter.

Many thanks again to sirbod for this great work! =D>
User avatar
IanB
Posts: 1055
Joined: Sun Sep 04, 2011 8:28 pm
Location: South Wales
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by IanB »

sirbod wrote: SATA->IDE is a different issue.
...
This can only be resolved with a hardware solution, one option is to use an adapter that does control -IOCS16. I've looked at dozens on eBay today and even though they say they support PIO, none of them visually appear to control -IOCS16, the pin appears to have no connection.
...
A more drastic option is to modify the RiscPC motherboard, by removing the pull up resistor on -IOCS16 and grounding it instead to force 16 bit transfers. Alternatively, modify an IDE cable to do the pull down.
...
This is all just a theory mind you, something that would need testing by someone more electronically minded than myself.
I investigated this a few years ago and found the above fix which was to strap -IOCS16 to an adjacent pin on the adapter which was at 0v (i.e. pin 32 to pin 30).
SATAtoIDE.jpg
The other thing to be aware of with CF cards is that they can stop the NIC from working and I posted details of the fix for that here:
viewtopic.php?f=16&t=10545&p=131375#p131375

"The problem is caused by the "Ready" signal on Pin 27 of the IDE interface which is shared with the network card. It's probably meant to be pulled high weakly and driven low by open drain outputs on the network and IDE interface, however it looks like the adapters and some CF card are driving it high which causes any network card that makes use of that signal to fail.
However, the fix is fairly straightforward and that is to put a diode in the Ready line between the CF cards and the IDE socket on the RISC PC with the cathode of the diode (banded end) towards the CF card.
I used a schottky diode as that had a lower voltage drop but any small signal diode like a 1N4148 should work. I found it easier to cut wire 27 of the IDE cable to fit the diode rather than modify the PCB."

Since making that post last year I found a simple way to mod one of the readily available CF to IDE converters with a track cut on one side and the diode on the other:
CFmodSide1.jpg
CFmodSide2.jpg
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by sirbod »

IanB wrote:I investigated this a few years ago and found the above fix which was to strap -IOCS16 to an adjacent pin on the adapter which was at 0v (i.e. pin 32 to pin 30).
It should really be pulled down via a 1k8 resistor as its TTL 5v. I have previously tested both pull-down and grounding and found it's not always consistent, in that it sometimes works and other times doesn't. Unfortunately, I've not had any free time to investigate further since fixing both Disc Error 20 and 21, which may also play a factor.
IanB wrote:"The problem is caused by the "Ready" signal on Pin 27 of the IDE interface which is shared with the network card. It's probably meant to be pulled high weakly and driven low by open drain outputs on the network and IDE interface, however it looks like the adapters and some CF card are driving it high which causes any network card that makes use of that signal to fail.
However, the fix is fairly straightforward and that is to put a diode in the Ready line between the CF cards and the IDE socket on the RISC PC with the cathode of the diode (banded end) towards the CF card.
I used a schottky diode as that had a lower voltage drop but any small signal diode like a 1N4148 should work. I found it easier to cut wire 27 of the IDE cable to fit the diode rather than modify the PCB."
That is very useful to know, I'm not sure how I missed your original post on the subject but it will save me investigating the issue further. I'm planning on making a small board to go between the motherboard and IDE cable, so a fix can be retroactively applied without modifying either the adapter or the motherboard.
Phlamethrower
Posts: 137
Joined: Fri Nov 24, 2017 1:35 pm
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by Phlamethrower »

sirbod wrote: Thu Nov 30, 2017 8:38 amCan I also presume that Disc Error 23 does not occur on A7000/RiscPC, meaning all the compatibility issues are resolved by Jeffrey's beta ROMpatch, or the patcher in the OP? Jeffrey's updated ROMpatch should be used in preference, as it hangs off TickerV instead of stalling the CPU.
Just posting an update to say that the ROM patch is now included as standard in the ROOL hard disc image. I.e. future visitors to this thread should probably download the patch from there instead of using whatever crusty old version I have on my website!

https://www.riscosopen.org/content/downloads/common

Both the stable 5.24 disc image and the nightly beta contains the patches. To install it into your existing boot sequence, you need to go to the appropriate !Boot.ROXXXHook.Boot.PreDesk folder in the downloaded image, then copy !!ROMPatch and the ROMPatch folder to !Boot.Choices.Boot.PreDesk in your current ROM boot sequence (and preferably to ROXXXHook as well, so that it stays around if you ever run !ResetBoot). Note that you'll also need a 32bit CLib and (probably) CallASWI, both of which you can find in the "System Resources" ROOL download if needed. Don't be tempted to take a copy of CLib from the ROOL disc image and run it on a 26bit OS version because it won't work!
User avatar
Sniffer
Posts: 200
Joined: Tue Aug 11, 2015 10:30 pm
Location: Colwyn Bay, North Wales
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by Sniffer »

I know, another post to an old thread but I've been trying to quieten down my A5000 so I replaced the PSU fan with a silent one and the Conner IDE with a dual CF adapter, with two 512MB cards.

They won't format with ADFS v2.67, giving an error 23. They do format with the patched ADFS v2.68 but give error 23 as soon as I attempt to write to them.

Should the patched ADFS cure this issue on an A5000 with Risc OS 3.10?
User avatar
drygol
Posts: 29
Joined: Mon Oct 15, 2018 6:55 am
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by drygol »

I've been trying to fix this CF2IDE module in my A3020 with RO 3 but it looks like I am not getting anywhere.
I am kinda noob if it is about Archimedes series so I've no idea how to use a pre-patch loaded through gotek.
It would be way easier if I've burned a 27c800 EPROM that fixes the issue but it looks like there is none available, or am I missing something?
User avatar
IanS
Posts: 2535
Joined: Mon Aug 31, 2009 7:02 pm
Location: UK
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by IanS »

drygol wrote: Tue Feb 25, 2020 2:36 pm It would be way easier if I've burned a 27c800 EPROM that fixes the issue but it looks like there is none available, or am I missing something?
Is this for the 5th Column rom socket? It will take a 28-pin eprom with the link set correctly.
Has anyone produced a 5th column rom image for patch on an A5000. Or it is better to just use wizzo (in the 5th column)?
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by danielj »

For the A5000 it certainly makes more sense just to use WIzzo IDEFS in the 5th Column and have multiple partitions.

d.
User avatar
drygol
Posts: 29
Joined: Mon Oct 15, 2018 6:55 am
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by drygol »

Maybe it'll be easier if I've pasted a pic of a mobo

Image
User avatar
drygol
Posts: 29
Joined: Mon Oct 15, 2018 6:55 am
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by drygol »

Maybe it'll be easier if I've pasted a pico of a mobo
Image

EDIT:

OK, I've sorted it out. I just redid a hardware mod on a CF2IDE and used another card - SANDISK this time.
And it freakin works finally :D

Thank you everyone for help.

Cheers
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by danielj »

Glad you got it working - what was the hardware mod you did? And there are indeed some CF cards that work, but it's very hit-and-miss as you've discovered!

d.
User avatar
drygol
Posts: 29
Joined: Mon Oct 15, 2018 6:55 am
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by drygol »

The mod that was described here somewhere by IanB - solder blob between pin 30 and 32 on a CF2IDE adapter. I've also added a diode as suggested.
However, this didn't help and all three CF cards didn't work - 4GB Kingston, 4GB Transcend and 256MB TwinMOS.
That was the moment I've realized that there is a similar issue with Divide2k14 for ZX Spectrum and I have a 4GB Sandisk CF there so I've tried it and it worked like a charm :)
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by sirbod »

drygol wrote: Wed Feb 26, 2020 10:20 am all three CF cards didn't work - 4GB Kingston, 4GB Transcend and 256MB TwinMOS.
Loading the patched ADFS 2.68 in the OP should get them working, admittedly not much use unless you boot from floppy first.

We need to make more progress on RISC OS 3.20 - I need someone to help compile the ROM based Modules before its viable on tin.
User avatar
drygol
Posts: 29
Joined: Mon Oct 15, 2018 6:55 am
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by drygol »

Got it. In my case, it was easier to mod hardware and find a working CF card since I have little to NO knowledge about Archies :D
This is actually my first working Archie :D
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by danielj »

From the grave...

I've just been toying around with trying to get some things to build under 3.7 using the old Acorn compiler. I've essentially taken ADFS 3.29 and, I hope, backported the changes made in the ROOL release to that. This should therefore be a "fixed" adfs which will work in RiscPCs. I realise that this probably seems pointless to many given that the later module can be deployed, but this can be built on the system it's meant to fix with the toolchain that built the 3.7 ROM (which is quite nice really) - it's numbered 3.30a at the moment as it's a step up from 3.29 and I thought I'd see if a letter worked.

It doesn't break RPCEmu, but that's not necessarily a good test. Does anyone have facility to give it a go? I don't have a spare CF adaptor for my RPC at the moment, but I have ordered one. I *STRONGLY ADVISE PEOPLE NOT TO USE IT ON A DISC THEY CARE ABOUT*! :D
Attachments
ADFS.zip
(17.5 KiB) Downloaded 97 times
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by danielj »

- just to confirm, 3.29 (on which this is based) does have the ADFSBuffers fix:
https://gitlab.riscosopen.org/RiscOS/So ... 3db832f45a
User avatar
Mattmos
Posts: 79
Joined: Sat Jul 31, 2021 4:42 pm
Location: UK
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by Mattmos »

sirbod wrote: Wed Nov 08, 2017 7:53 am I've been looking at these issues on a RiscPC and have now tested dozens of SD/CF/SATA devices on the native IDE with stock ADFS in RISC OS 3.70.
(snip)

Fix Disc Error 20 and 23 on A3020, A4000, A5000 - use ADFS268 attached below in preference to this

Code: Select all

REM Live patch ADFS pre RiscPC for Disc Error 20 / 23
...
Digging this thread up: I found these fixes very helpful when trying to get a Castle IDE podule working with a CF, any CF at all, on an A440 with RISC OS 3.11.

The card I have is a Castle "IDE-Euro Issue 2", originally holding an internal 2.5" drive. I couldn't for the life of me find a CF card that worked. All would lock up on first access; the least bad one at least identified the disc name, but reading the catalog failed (23, IIRC).

I found these patches got it working (the working disc name may have been a single read, then broken further accesses fits the multi-read failure mode), so first thank you for all the reverse-engineering. :)

But, I had a chicken-and-egg, as I needed CF to be the only boot medium. (The FDD in this machine is too finicky.) I wrote the following module, which applies your patches to ADFS:

https://github.com/evansm7/adfs_patcher

I programmed this into flash in my IDE podule, and now I can boot using CF alone. :D :D

There are loads of better solutions, such as using a fixed RISC OS image/more modern ADFS module, but this for me was the right direction as I was moving the IDE podule between machines and wanted it to Just Work without dependencies on the machine. Also, the Castle IDE card actually has a ROM, not flash, and it needed some persuasion to take a flash chip. Fortunately, the 32KB image is mostly empty, and this module (744 bytes) could easily be patched in.

The module code might also be useful as a basis for other hackers wanting to apply patches to ROM modules at boot?

Thanks again for the ADFS fixes, they made my setup happy again.
User avatar
IanJeffray
Posts: 5962
Joined: Sat Jun 06, 2020 3:50 pm
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by IanJeffray »

Mattmos wrote: Sun Sep 12, 2021 7:58 pm I found these fixes very helpful when trying to get a Castle IDE podule working
An IDE podule that provides the ADFS hooks? The only time I've heard of this before was PhilB's Amazing Ethernet/storage/etc podule.
Can you give more details about the Castle card?

I gave up with ADFS for IDE and use Wizzo everywhere now as a matter of course - for the 'onboard' IDE interface.
User avatar
IanS
Posts: 2535
Joined: Mon Aug 31, 2009 7:02 pm
Location: UK
Contact:

Re: Disc Error 20/21/23 and SATA->IDE support

Post by IanS »

The castle mini-podule uses the hook into ADFS - viewtopic.php?p=237315#p237315
Post Reply

Return to “32-bit acorn hardware”