Chuck Guzis <ccl...@sydex.com> wrote:

On 12/10/2015 12:18 AM, Oliver Lehmann wrote:

for LBA:

while ( pata_bsy() ) {}

write_io_register ( PATA_RW_SECTOR_COUNT_REGISTER, 1 );
write_io_register ( PATA_RW_SECTOR_NUMBER_REGISTER, 0 );
write_io_register ( PATA_RW_CYLINDER_LOW_REGISTER, 0 );
write_io_register ( PATA_RW_CYLINDER_HIGH_REGISTER, 0 );
write_io_register ( PATA_RW_DEVICE_HEAD_REGISTER, 0xa0 );

write_io_register ( PATA_W_COMMAND_REGISTER, 0x21 );

while ( pata_bsy() ) {} if
 ( pata_err() ) { return; } while (
!pata_drq() ) {}

If you're using LBA, should this be the setting:

 write_io_register ( PATA_RW_DEVICE_HEAD_REGISTER, 0xe0 );

Bit 6 indicates LBA.

right - This is what I do in the code - I was writing "from memory".

Also, note that if you're using drives larger than about 120GB, the PATA-6 protocol comes into effect with 48-bit sector addresses.

OK - good to know. I only tested ranges 260MB - 80GB. Guess I'll just
not support it then?! How is it different regarding setting the
registers? But anyway... The host computer only supports 32bit
adressing of 512Byte Blocks. And I guess I could also use 500GB
IDE disks when using only lets say some hundrets of MB (plenty
enough - the original harddisk in the system had about 54MB)

Oliver

Reply via email to