View Single Post
Old 03 June 2011, 15:16   #16
AmigTart
 
Posts: n/a
Quote:
Originally Posted by alexh View Post
I was replying to someone over at Amiga.org about MAX TRANSFER settings for IDE controllers (such as A1200/A600 Gayle IDE) giving them the standard "try 0x1FE00 and if that doesnt work try 0xFE00".

While writing I accidentally worked out the logical reason behind these "Magic numbers".
  • IDE commands (ATA5 or lower) have "sector count" field which is 8-bits.
  • SCSI commands (SCSI10) have a "transfer size" field which is 16-bits.
For those who do not know, a sector is the smallest individual amount you can access on a Hard drive and has always been (until recently) 512 bytes. And "sector count / transfer size" is the amount to be transferred in a single command.

I noticed that "0x1FE00" is 255 * 512, and that 255 is the largest value that can be represented by 8-bits. So by using "0x1FE00" it prevents the driver (scsi.device) creating malformed IDE commands with sector counts larger than 8-bit.

I am positive this is the logical answer as to why MAX TRANSFER should be "0x1FE00" for IDE devices.------------
Actually, max sector count by IDE (ATA) is 256 sectors, because 0 in sector count registers means not 0 (nonsense) but 256 .

With 48-bit LBA (what is necessary with drives over 128GB) max count is 65536 as sector count is given as 16-bit value.
 
 
Page generated in 0.07746 seconds with 11 queries