📚 AOS Docs

ATA/IDE Storage Driver

Hard Disk Access via Programmed I/O

Overview

The ATA (Advanced Technology Attachment) driver enables AOS to communicate with hard disk drives via the IDE (Integrated Drive Electronics) interface. AOS supports ATA PIO mode, the slowest but most compatible method.

What is ATA/IDE?

ATA is a protocol for communicating with storage devices:

ATA Port I/O Addressing

Primary Channel

Port Register Purpose
0x1F0 Data Read/Write sector data
0x1F2 Sector Count Number of sectors to read/write
0x1F3-0x1F5 LBA First sector address (28-bit)
0x1F6 Drive/Head Select master/slave
0x1F7 Status/Command Read status or write command

ATA Commands

Command Code Purpose
Read Sectors 0x20 Read disk sectors into buffer
Write Sectors 0x30 Write buffer to disk sectors
Identify 0xEC Get drive information

Key Takeaways

  • ✓ ATA/IDE uses I/O port addressing for disk control
  • ✓ LBA (Logical Block Addressing) for sector access
  • ✓ PIO mode reads/writes data directly via ports
  • ✓ Status register polling indicates progress
  • ✓ Error checking prevents silent corruption
  • ✓ Partition offset found in Master Boot Record