English Amiga Board


Go Back   English Amiga Board > Support > support.Hardware

 
 
Thread Tools
Old 05 June 2011, 00:59   #21
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,335
Using the onboard IDE?
alexh is online now  
Old 05 June 2011, 01:00   #22
Retro-Nerd
Missile Command Champion
 
Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 52
Posts: 12,435
Yes.
Retro-Nerd is offline  
Old 05 June 2011, 01:05   #23
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,335
Well maybe rkauer is right that it is not a sector count problem.

I cannot imagine his description of what could be going wrong is the truth though. Pretty sure IDE is 100% flow controlled. CF cards even without a buffer are many, many times faster than the old 2.5" PATA hard drives of the time.
alexh is online now  
Old 05 June 2011, 14:17   #24
Jope
-
 
Jope's Avatar
 
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,861
I can verify that 1fe00 is needed with many real hard disks too.
Jope is online now  
Old 05 June 2011, 14:56   #25
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
I may have (finally) found the problem..

When AOS IDE driver gets transfer that is longer than 256 bytes, it splits it in two or more pieces (because max ATA transfer is 256 blocks). After first piece has finished, it reads IDE CHS/LBA registers, adds one to address and then writes it back as start address of second piece. (ATA spec says they contain last read/written address) So far so good but:

ATA-1 spec says:

At command completion, the Command Block Registers contain the cylinder, head, and sector number of the last sector read.

ATA-2 spec says:

This register shall be updated to reflect the media address of the error when a media access command is unsuccessfully completed.

NOTE 9 - Prior to the development of this standard, this register was updated at the end of every media access command to reflect the current media address

In other words ATA-2 or newer device does not need to update CHS/LBA address after command finishes normally, only in error situations. This will break AOS ATA driver logic, start address of second piece becomes invalid (I assume drive keeps old values unmodified, second piece of data overwrites beginning of first piece which also explains why filesystem structure corruption has never been reported, only data corruption)

NOTE: This theory is not tested! (EDIT: it is now)

Last edited by Toni Wilen; 14 August 2011 at 11:15.
Toni Wilen is offline  
Old 05 June 2011, 14:56   #26
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,335
I tried it today with every 2.5" PATA drive I have and if I set the MAX TRANSFER above 0x1FE00 I get data corruption on a READ on all of them.

The file has to be larger than 255 sectors obviously!
alexh is online now  
Old 05 June 2011, 15:34   #27
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
Quote:
Originally Posted by Retro-Nerd View Post
Really? I never had any issues with standard MaxTransfer settings and PC hard drives. Pure luck?
Me either..
Hewitson is online now  
Old 05 June 2011, 17:15   #28
Retro-Nerd
Missile Command Champion
 
Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 52
Posts: 12,435
I've used PC drives in the 90s on my A1200 and now since 2007 with the standard MaxTransfer settings. No problems at all. To be honest: never heard/read of this 1fe00 setting before the IDE-CF HD solution became popular, and there it's obviously needed. X-file?
Retro-Nerd is offline  
Old 05 June 2011, 17:16   #29
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,335
All my hard drives are very modern PC laptop hard drives. Dunno if that makes any difference?
alexh is online now  
Old 05 June 2011, 17:25   #30
Gordon
Settler
 
Gordon's Avatar
 
Join Date: Feb 2007
Location: Serf City
Posts: 1,760
I bumped this thread becuase when i installed classic wb on my 10.1gb 2.5 IDE hard drive(over 10 yeas old), some programs didnt open and some games came back with illegal expression errors. I reinstaled everything again after setting the drive to 0x1fe00 and it works fine.
Gordon is offline  
Old 05 June 2011, 17:32   #31
Retro-Nerd
Missile Command Champion
 
Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 52
Posts: 12,435
I've never used 2.5 HDs, only 3.5. Could this really make a difference?
Retro-Nerd is offline  
Old 05 June 2011, 19:20   #32
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,335
Not if it is malformed ATA commands as I suggested.

If I could be arsed I could easily prove it with our ATA analyser at work.

I wonder if IDE emulation on WinUAE is closely tied closely enough to the hardware to show this problem?

I know if you use the high-level UAE hard disk driver then it does not show up. (You can prep disks in WinUAE using the high level driver with MAX TRANSFER above 0x1FE00 which work fine in WinUAE but fail on Amiga)
alexh is online now  
Old 06 June 2011, 07:10   #33
rkauer
I hate potatos and shirts
 
rkauer's Avatar
 
Join Date: Oct 2007
Location: Sao Leopoldo / Brazil
Age: 58
Posts: 3,482
Send a message via MSN to rkauer Send a message via Yahoo to rkauer
@Alexh: I don't doubt your research, I just see the problem occurring mostly on CF & micro Drives (which doesn't have a cache memory between the inner "disk" controller and the outside IDE bus).

SCSI drives is another can of worms and they have their own behaviour.

The problem is related to the Amiga IDE and the way it talks to the devices hooked in. But I never had a validation problem before the CF era.

Now I had so much of those errors that I simply not use CF for anything but file transfers.
rkauer is offline  
Old 09 June 2011, 15:51   #34
AmigTart
 
Posts: n/a
I don't no much how Amiga OS works. But usually hard disk driver is responsible to take care about max sector counts possible with certain hard drives. So, if it exceeds it driver splits into several requests with allowed counts.

Considering buffering by CF cards: some may have it, some not. All it is pretty irrelevant on slow machines like Amiga. Modern CF cards are much faster. Buffer is needed mostly by slow mechanical hard disks. But by CF cards sector access times are much-much better, so buffer is not a must.

I see other problems with CF cards and old micros without some advanced ATA compatible IDE IF : signal timing problems. It is worst in case of writing. Problem is that usual IDE logics activate and deactivate IDE SELP (CS0) signal together with RD and WR signals. By ATA spec it is not so (must activate RD and WR later and deactivate earlier) . Was OK with old hard drives, but after 20 years things are different.
With Sandisk CF cards usually no timing problems, because they have better behaviour and different timing than usual CF cards (as Kingston). Of course, best is to design new IDE (ATA) adapters with better signal timing, according to new ATA specs.
 
Old 10 June 2011, 00:22   #35
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,335
Quote:
Originally Posted by AmigTart View Post
I don't no much how Amiga OS works. But usually hard disk driver is responsible to take care about max sector counts possible with certain hard drives. So, if it exceeds it driver splits into several requests with allowed counts.
I thought that was what MAX TRANSFER was for. It tells some part of the OS/driver the limit at which a file system request of N bytes is split into multiple transfers.
alexh is online now  
Old 10 June 2011, 07:58   #36
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by alexh View Post
I thought that was what MAX TRANSFER was for. It tells some part of the OS/driver the limit at which a file system request of N bytes is split into multiple transfers.
Max transfer is filesystem parameter, filesystem (if it cares about the parameter) splits the request in less than max transfer pieces before sending it to device driver.

Device driver does not know nothing about max transfer parameter.

(and check also post 25)
Toni Wilen is offline  
Old 10 June 2011, 08:06   #37
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Originally Posted by Toni Wilen View Post
Device driver does not know nothing about max transfer parameter.
Yes, but the device driver should know the limitations of the hardware it drives. In this case, the ATA driver should know about the 256 sector limit of ATA commands and if a larger amount of sectors is to be transferred, it should split it automatically into multiple ATA commands or use another ATA command which can transfer more than 256 sectors.

BTW, WinUAE emulates the MaxTransfer problem on the internal IDE port, too. So if this wasn't intentional, then it's really scsi.device which sends malformed ATA commands to the hardware and not some missing cache on the harddrive or something.
thomas is offline  
Old 10 June 2011, 08:12   #38
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Originally Posted by Toni Wilen View Post
In other words ATA-2 or newer device does not need to update CHS/LBA address after command finishes normally, only in error situations. This will break AOS ATA driver logic, start address of second piece becomes invalid (I assume drive keeps old values unmodified, second piece of data overwrites beginning of first piece which also explains why filesystem structure corruption has never been reported, only data corruption)

NOTE: This theory is not tested!

If you examine the data written by WinUAE to a HDF connected to IDE0, you'll see exactly this: if you transfer 257 sectors (0 - 256), sector 1 to 255 are written correctly, sector 0 contains the data of written sector 256 and sector 256 remains unchanged.
thomas is offline  
Old 10 June 2011, 08:36   #39
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,335
Quote:
Originally Posted by Toni Wilen View Post
(and check also post 25)
I missed that post. That certainly explains why only some devices are affected. Seems dumb to read the tailgate status to form the next command but hey.

I know that our modern ATA8 hard drive controllers always update the tailgate status for all commands, not just errors.
alexh is online now  
Old 10 June 2011, 08:41   #40
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by thomas View Post
Yes, but the device driver should know the limitations of the hardware it drives. In this case, the ATA driver should know about the 256 sector limit of ATA commands and if a larger amount of sectors is to be transferred, it should split it automatically into multiple ATA commands or use another ATA command which can transfer more than 256 sectors.
It does split it properly but unfortunately splitting uses ATA feature that was removed in later ATA specs.

Quote:
Originally Posted by thomas View Post
If you examine the data written by WinUAE to a HDF connected to IDE0, you'll see exactly this: if you transfer 257 sectors (0 - 256), sector 1 to 255 are written correctly, sector 0 contains the data of written sector 256 and sector 256 remains unchanged.
Thanks, this should confirm my theory.

Should WinUAE detect this situation and warn about it? It is easy to emulate this exactly as ATA-1 spec says which is technically right thing to do but may not the best choice from non-technical point of view
Toni Wilen is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
CF Hd Max Transfer Problem flushentity support.Hardware 2 12 May 2012 22:15
IDE max transfer (CF, Hard disk, FAT95) xraynorm support.Hardware 2 27 March 2011 20:58
Max transfer & mask for CF card? PowerPie5000 support.Hardware 7 29 November 2010 12:35
IDE & Max Transfer-temp prowler support.Hardware 0 16 June 2009 21:30
CF to IDE adapter - Max size card? crispywotsits support.Other 11 19 February 2009 16:38

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12630 seconds with 13 queries