Wednesday, December 28, 2011

ATA device control

I added new driver.
It has ATA and ATAPI control function.
HDD is controlled PIO mode and LBA.

  • First, Initialize ATA and ATAPI device.
Execute soft reset.

Read Cylinder Low inb(0x01f4);

Read Cylinder High inb(0x01f5);

Input Cylinder Low and High to get device type.

(We can confirm ATA device when Cylinder High and Low is Zero.

 We can confirm ATAPI device when Cylinder High is 0xeb and Cylinder Low is 0x14.)

Identify device.

Execute device selection protocol.

Wait until BSY to Zero.
Wait DRQ to active.
Read 256 byte sectors for prepare.

  • Next, read sector from ATA device.
I will write this section tomorrow.... sorry.

No comments:

Post a Comment