00001 /* header file for src/ata.cpp */ 00002 00003 #ifndef _CORE_DRIVERS_ATA_HPP 00004 #define _CORE_DRIVERS_ATA_HPP 00005 00006 const uint16 ATA_PORT = 0x1f0; 00007 //command block registers 00008 const uint16 PORT_DRIVEHEAD = 0x6; 00009 const uint16 PORT_SECTORCOUNT = 0x2; 00010 const uint16 PORT_SECTORNUM = 0x3; 00011 const uint16 PORT_CYLLOW = 0x4; 00012 const uint16 PORT_CYLHIGH = 0x5; 00013 const uint16 PORT_CMD = 0x7; 00014 const uint16 PORT_STATUS = 0x7; 00015 //commands 00016 const uint8 ATA_READWRETRY = 0x20; //read with retries 00017 const uint8 ATA_READMULTIPLEEXT = 0x29; //read multiple extended- 48bit 00018 const uint8 ATA_READMULTI = 0xc4; 00019 //stuff 00020 const bool ATA_PRIMARY = 0; 00021 const bool ATA_SECONDARY = 1; 00022 const uint8 ATA_BUSY = 0x80; //for the PORT_STATUS read 00023 const uint8 ATA_LBA = 0x40; //for read multiple ext 00024 00025 void ATAReadSector(int nDriveIndex, void *buf, uint64 block, int byte_offset, int nbytes); 00026 void sub(); 00027 00028 #endif