ATA Driver.asm

This file contains procedures for managing ATA (harddrive) operations.

See Also

  • <ATAPI Driver.asm>

Authors

  • Neil G.  Dickson
Summary
ATA Driver.asmThis file contains procedures for managing ATA (harddrive) operations.
Functions
IntIDE0This interrupt handles completed ATA operations on IDE0.
IntIDE1This interrupt handles completed ATA operations on IDE1.
ATAReadSectorsThis procedure handles calling of ATAReadSectors28 or ATAReadSectors48 depending on device capabilities.
ATAReadSectors28Manages I/O with ATA device to read sectors in 28-bit mode.
ATAReadSectors48Manages I/O with ATA device to read sectors in 48-bit mode.
ATAReadSectorsDMAManages I/O with ATA device via DMA to read sectors.
ATAIsValidDeviceChecks the ATADEVICEINFO of the specified device to see if it is a valid, supported device.

Functions

IntIDE0

This interrupt handles completed ATA operations on IDE0.

IntIDE1

This interrupt handles completed ATA operations on IDE1.

ATAReadSectors

This procedure handles calling of ATAReadSectors28 or ATAReadSectors48 depending on device capabilities.

TODO: Determine whether the 28-bit and 48-bit maximum # of sectors numbers are big-endian, little-endian, or some mix.

TODO: Determine whether they are actually 1 more than the maximum quantity, or 1 more than the maximum LBA (reference says both, so maybe LBA starts @ 1, not 0)

Parameters

pDestaddress of destination memory
Drive0To3index from 0 to 3 selecting the drive
SectorNumLowlow 32 bits of sector number from which to read
SectorNumHighhigh 32 bits of sector number from which to read
nSectorsnumber of sectors to read

ATAReadSectors28

Manages I/O with ATA device to read sectors in 28-bit mode.  This shouldn’t be called from outside: call ATAReadSectors.

Parameters

pDestaddress of destination memory
DriveNumATA-relevant device number
SectorNumsector number from which to read
nSectorsnumber of sectors to read

ATAReadSectors48

Manages I/O with ATA device to read sectors in 48-bit mode.  This shouldn’t be called from outside: call ATAReadSectors.

Parameters

pDestaddress of destination memory
DriveNumATA-relevant device number
SectorNumLowlow 32 bits of sector number from which to read
SectorNumHighhigh 32 bits of sector number from which to read
nSectorsnumber of sectors to read

ATAReadSectorsDMA

Manages I/O with ATA device via DMA to read sectors.  This shouldn’t be called from outside: call ATAReadSectors.

Parameters

pDestaddress of destination memory
DriveNumATA-relevant device number
SectorNumLowlow 32 bits of sector number from which to read
SectorNumHighhigh 32 bits of sector number from which to read
nSectorsnumber of sectors to read

ATAIsValidDevice

Checks the ATADEVICEINFO of the specified device to see if it is a valid, supported device.

Parameters

Drive0To3ATA device index, from 0 to 3

Returns

eaxthe address of the corresponding ATADEVICEINFO if valid, otherwise 0
ecxnSectorsLow if valid
edxnSectorsHigh if valid
Manages I/O with ATA device to read sectors in 28-bit mode.
Manages I/O with ATA device to read sectors in 48-bit mode.
This structure defines a hardware device connected through the ATA controller (mostly harddrives and CD/DVD drives).
This procedure handles calling of ATAReadSectors28 or ATAReadSectors48 depending on device capabilities.