02 April 2008, 17:21 | #1 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,603
|
Amiga IDE LBA48 patch
I found something interesting when I was implementing LBA48 support to IDE emulation. OS3.9BB2 scsi.device (v43.43) does have LBA48 support but it has bug that freezes or crashes the Amiga..
I fixed the bug (patch details below) and now (at least in emulation) my A1200 IDE 160G test hard file works perfectly with full capacity. This may also fix common v43.43 scsi.device boot freeze if drive has LBA48 support. (but older scsi.device versions work). Confirmation needed. Patch is compatible with all v43.43 scsi.devices (A600/A1200/A4000) Please test if you have >128G IDE drive and/or you have boot freeze without NOROMUPDATES or SKIPROMUPDATES scsi.device Patch offsets in OS39BB2 "ROM Updates" file (near "Conner Peripherals 20MB - CP2024" string) 31A2C 358AC 3DACA Old values: 43FA 000E 3219 B001 66FA E049 3001 4E75 0220 02C4 0430 04C5 02EC 0450 0070 0010 0091 00C6 0040 0090 0000 New values: 43FA 0018 7200 0C11 00FF 6606 5289 1219 6704 B019 66F0 3001 4E75 FF02 C429 2024 ECFF 04C5 3930 3450 FF00 Also spatch-patch file attached if you don't want to do manual patching (patches OS39BB2 "DEVS:AmigaOS ROM Update". Remember backups) WARNING: Patching HD drivers is always dangerous, data loss is always possibility. Next follows my random notes, no need to understand this Old code that returns garbage after LBA48 command: 10FEF2A0 43fa 000e LEA.L (PC,$000e) == $10fef2b0,A1 10FEF2A4 3219 MOVE.W (A1)+,D1 10FEF2A6 b001 CMP.B D1,D0 10FEF2A8 66fa BNE.B #$fffffffa == $10FEF2A4 10FEF2AA e049 LSR.W #$00000008,D1 10FEF2AC 3001 MOVE.W D1,D0 10FEF2AE 4e75 RTS.L 10FEF2B0 0220 02C4 0430 04C5 02EC 0450 0070 0010 10FEF2C0 0091 00C6 0040 0090 0000 20 = read sectors c4 = read multiple 30 = write sectors c5 = write multiple ec = identify drive 50 = format 70 = seek 10 = recalibrate 91 = initialize drive parameters c6 = set multiple mode 40 = read verify sectors 90 = execute drive diagnostics 00 = nop New code (different because space was really tight..) 43FA 0018 lea data(pc),a1 7200 moveq #0,d1 0C11 00FF l1 cmp.b #$ff,(a1) 6606 bne.s l2 5289 addq.l #1,a1 1219 move.b (a1)+,d1 6704 beq.s l3 B019 l2 cmp.b (a1)+,d0 66F0 bne.s l1 3001 l3 move.w d1,d0 4E75 rts dat dc.b 0xff,0x02,0xc4,0x29,0x20,0x24,0xec dc.b 0xff,0x04,0xc5,0x39,0x30,0x34,0x50 dc.b 0xff,0x00 This adds following missing LBA48 commands: 29 = read multiple ext 39 = write multiple ext 24 = read sectors ext 34 = write sectors ext Meaning of this table is to return 2 (if read command), 4 (if write command) or 0 (no data). Someone simply forgot to add new LBA48 commands to this table when LBA48 support was implemented.. Last edited by Toni Wilen; 03 April 2008 at 16:09. |
02 April 2008, 17:27 | #2 |
.
Join Date: Oct 2004
Location: Ioannina/Greece
Posts: 5,040
|
amazing
|
02 April 2008, 17:37 | #3 |
(Amigas && Amigos)++
Join Date: Sep 2005
Location: Anrea
Posts: 999
|
WOW, this must be the reason BB2 ROM Update did not work on my A4000D causing it to hang while booting, and why it worked on my A4000T as I then had another >128GB drive connected to the UWSCSI instead of the IDE! And it did work when I skipped the scsi update.
I have to get it out of storage to try it - I hope it still has that same hard drive in it. By your comments Toni, I guess they didn't have a proper regression test suite. EDIT: Here is the old thread of which includes my hard drive problems, which sounds like it may all have been due to this bug. Refer to post 36 for the same symptom, other posts before possible hard drive symptoms cause by same bug, and posts after for trying to find solution. Yes the thread reminds me why I switched to an A4000T: http://eab.abime.net/showthread.php?t=22181 Last edited by Calgor; 02 April 2008 at 17:49. |
03 April 2008, 00:10 | #4 |
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 14,624
|
Good work.
It is so strange, this topic was active only the other week after someone posted incorrectly that this was a hardware limitation, and I spent too much time ranting about how it needed to use the EXT commands ;-) Ah, 0x25, 0x35 (They are the DMA ones rather than PIO) etc. I've spent too much time looking at this while developing SATA RAID controllers. |
03 April 2008, 08:34 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,603
|
This time (or was it?!) it was just a coincidence, I read some rumours about OS39BB2 scsi.device having LBA48 support. I wanted to confirm that rumour but I didn't want to implement LBA48 without some help. Finally few days ago I accidentally noticed Bochs having LBA48 support.
|
03 April 2008, 10:10 | #6 |
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 14,624
|
http://eab.abime.net/showthread.php?...hlight=pio+ext
http://eab.abime.net/showthread.php?...hlight=pio+ext Thomas noted in one of the threads I was talking about LB48 last month that the change log for scsi.device in BB2 had LBA48 but it didnt work. Maybe that was your inspiration? It doesnt really matter. Again very nice work. I really disliked that Elbox would try to charge a premium for LBA48 on their IDE splitter which obviously connected to the internal IDE adapter! Last edited by alexh; 03 April 2008 at 10:22. |
03 April 2008, 10:25 | #7 |
.
Join Date: Oct 2004
Location: Ioannina/Greece
Posts: 5,040
|
so... any chance of posting the modified amigaosromupdate? or the spatch for it?
I feel a little uncofortable patching it manual, this a very sensitive part |
03 April 2008, 11:34 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,603
|
|
03 April 2008, 16:09 | #9 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,603
|
Patch attached.
|
05 April 2008, 15:48 | #10 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,047
|
Quote:
First of all, scsi.device does *not* crash as soon as the drive is connected. I could successfully install the drive and create a small boot partition. The crash only happens if I create a partition above the 128 GB border. And I can simply disable this partition in the early startup menu in order to boot. However, your patch works perfectly. I didn't see any problem yet. |
|
05 April 2008, 15:57 | #11 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,603
|
Ah, that explains it. hdtoolbox version I used automatically created partitions (19 8G partitions..) so that explains the immediate crash after initialization and reboot.
|
12 May 2008, 13:19 | #12 |
Retronerd
Join Date: Aug 2002
Location: Hamburg (Germany)
Age: 50
Posts: 88
|
Thanx a lot!
|
14 May 2008, 05:41 | #13 | |
I hate potatos and shirts
|
Quote:
Now finally we can use any HD in the market inside the Amiga. Of course: now we need a new hdtoolbox to use the full space provided by your patch. @ All coders: we need your help! |
|
14 May 2008, 06:50 | #14 |
(Amigas && Amigos)++
Join Date: Sep 2005
Location: Anrea
Posts: 999
|
What is the limit in hard drive size to this implementation of LBA48? I ask because not all LBA48 implementations are the same.
|
14 May 2008, 09:07 | #15 |
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 14,624
|
Eh? If they are not 48-bit LBA then surely they are not LBA48?
144 petabytes (144,000,000 gigabytes) |
14 May 2008, 10:26 | #16 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,603
|
Quote:
Quote:
|
||
14 May 2008, 10:42 | #17 |
(Amigas && Amigos)++
Join Date: Sep 2005
Location: Anrea
Posts: 999
|
Thanks Toni.
As of sometime last year, the Elbox LBA48 driver for FastATA MK-III only handled drives up to 2TB (32 bits - signed?, not 48). It may already have been updated for all I know along with the recent OS4 version updates now that we are going to be having drives of that size soon enough. EDIT: 32 bits for sectors of 512 bytes = 2TB Last edited by Calgor; 16 May 2008 at 16:28. |
15 May 2008, 17:44 | #18 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,603
|
Tested: HDToolbox and HDInstTools (6.9) don't work very well with 1T+ drives..
Any other (non-ancient) partitioning programs? |
30 September 2008, 11:14 | #19 |
FPGA Replay inside A590
Join Date: Sep 2004
Location: Rotterdam/Netherlands
Age: 58
Posts: 294
|
Sorry for this stupid question, but how to apply this patch ?
I'm lost Last edited by wizard66; 30 September 2008 at 12:56. |
30 September 2008, 18:14 | #20 |
Registered User
Join Date: Jun 2008
Location: planet earth
Posts: 1,115
|
get the aminet patch: http://aminet.net/package/driver/media/SCSI4345p
its the same, same author and it has all you need, incl. description on how to patch it. hope this helps. Edit: you need this too: http://aminet.net/package/util/boot/LoadModule contains the ExtractModule tool. see SCSI4345p.readme Last edited by hit; 30 September 2008 at 18:20. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amiga 1200 floppy drive No click patch | beejack | request.Apps | 29 | 30 June 2020 22:07 |
issues cf ide pcmcia cfs fat95 x4 ide | jimmer78 | support.Hardware | 9 | 29 April 2010 00:15 |
three in one? (SCSI Patch,Mac Patch,MapRom) | RogerWilco09 | support.Apps | 0 | 05 May 2009 16:56 |
HELP! CD to IDE Through SCSI to IDE (IDSC21-E) ON A2091 | kjmann14 | support.Hardware | 1 | 04 May 2009 07:54 |
SCSI-IDE bridge + IDE to CF adapter - How can I make a backup? | Tuffy | New to Emulation or Amiga scene | 2 | 02 April 2008 21:14 |
|
|