2 * Acess2 IDE Harddisk Driver
12 #define MAX_ATA_DISKS 4
13 #define SECTOR_SIZE 512
14 #define MAX_DMA_SECTORS (0x1000 / SECTOR_SIZE)
16 #define IDE_PRI_BASE 0x1F0
17 #define IDE_SEC_BASE 0x170
19 #define IDE_PRDT_LAST 0x8000
22 \brief Commands to be sent to HDD_CMD
39 Uint8 BootCode[0x1BE];
42 Uint8 Unused1; // Also CHS Start
43 Uint16 StartHi; // Also CHS Start
45 Uint8 Unused2; // Also CHS Length
46 Uint16 LengthHi; // Also CHS Length
49 } __attribute__ ((packed)) Parts[4];
50 Uint16 BootFlag; // = 0xAA 55
51 } __attribute__ ((packed)) tMBR;
67 tATA_Partition *Partitions;
71 extern tATA_Disk gATA_Disks[];
75 extern void ATA_int_MakePartition(tATA_Partition *Part, int Disk, int Num, Uint64 Start, Uint64 Length);
77 // --- MBR Parsing ---
78 extern void ATA_ParseMBR(int Disk, tMBR *MBR);
80 // --- IO Functions ---
81 extern int ATA_SetupIO(void);
82 extern Uint64 ATA_GetDiskSize(int Disk);
83 extern int ATA_ReadDMA(Uint8 Disk, Uint64 Address, Uint Count, void *Buffer);
84 extern int ATA_WriteDMA(Uint8 Disk, Uint64 Address, Uint Count, const void *Buffer);