2 * Acess2 IDE Harddisk Driver
12 #define MAX_ATA_DISKS 4
13 #define SECTOR_SIZE 512
14 #define ATA_TIMEOUT 2000 // 2s timeout
15 // Needed out of io.c because it's the max for Read/WriteDMA
16 #define MAX_DMA_SECTORS (0x1000 / SECTOR_SIZE)
21 Uint8 BootCode[0x1BE];
24 Uint8 Unused1; // Also CHS Start
25 Uint16 StartHi; // Also CHS Start
27 Uint8 Unused2; // Also CHS Length
28 Uint16 LengthHi; // Also CHS Length
31 } __attribute__ ((packed)) Parts[4];
32 Uint16 BootFlag; // = 0xAA 55
33 } __attribute__ ((packed)) tMBR;
49 tATA_Partition *Partitions;
53 extern tATA_Disk gATA_Disks[];
57 extern void ATA_int_MakePartition(tATA_Partition *Part, int Disk, int Num, Uint64 Start, Uint64 Length);
59 // --- MBR Parsing ---
60 extern void ATA_ParseMBR(int Disk, tMBR *MBR);
62 // --- IO Functions ---
63 extern int ATA_SetupIO(void);
64 extern Uint64 ATA_GetDiskSize(int Disk);
65 extern int ATA_ReadDMA(Uint8 Disk, Uint64 Address, Uint Count, void *Buffer);
66 extern int ATA_WriteDMA(Uint8 Disk, Uint64 Address, Uint Count, const void *Buffer);