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.

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

--Chuck




Reply via email to