X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FStorage%2FATA%2Fmain.c;h=7f8964d2af9be3dd300f0179da6eae26e80d7191;hb=4f1a9b430a3fa57bbe52a6a2fe546f6fe93c389d;hp=9760b4dcf3a2ef5aaedbb7f53e32126ea914caa5;hpb=87f2bb07687054bcc230e38fe4bc9f8198cc3668;p=tpg%2Facess2.git diff --git a/Modules/Storage/ATA/main.c b/Modules/Storage/ATA/main.c index 9760b4dc..7f8964d2 100644 --- a/Modules/Storage/ATA/main.c +++ b/Modules/Storage/ATA/main.c @@ -2,7 +2,7 @@ * Acess2 IDE Harddisk Driver * - main.c */ -#define DEBUG 1 +#define DEBUG 0 #define VERSION 0x0032 #include #include @@ -25,7 +25,7 @@ void ATA_int_MakePartition(tATA_Partition *Part, int Disk, int Num, Uint64 Start Uint16 ATA_GetBasePort(int Disk); // Filesystem Interface char *ATA_ReadDir(tVFS_Node *Node, int Pos); -tVFS_Node *ATA_FindDir(tVFS_Node *Node, char *Name); +tVFS_Node *ATA_FindDir(tVFS_Node *Node, const char *Name); Uint64 ATA_ReadFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer); Uint64 ATA_WriteFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer); int ATA_IOCtl(tVFS_Node *Node, int Id, void *Data); @@ -179,7 +179,11 @@ int ATA_ScanDisk(int Disk) // --- Scan Partitions --- LOG("Reading MBR"); // Read Boot Sector - ATA_ReadDMA( Disk, 0, 1, &mbr ); + if( ATA_ReadDMA( Disk, 0, 1, &mbr ) != 0 ) { + Log_Warning("ATA", "Error in reading MBR on %i", Disk); + LEAVE('i', 0); + return 0; + } // Check for a GPT table if(mbr.Parts[0].SystemID == 0xEE) @@ -192,7 +196,7 @@ int ATA_ScanDisk(int Disk) Debug_HexDump("ATA_ScanDisk", &mbr, 512); #endif - LEAVE('i', 0); + LEAVE('i', 1); return 1; } @@ -246,9 +250,9 @@ char *ATA_ReadDir(tVFS_Node *UNUSED(Node), int Pos) } /** - * \fn tVFS_Node *ATA_FindDir(tVFS_Node *Node, char *Name) + * \fn tVFS_Node *ATA_FindDir(tVFS_Node *Node, const char *Name) */ -tVFS_Node *ATA_FindDir(tVFS_Node *UNUSED(Node), char *Name) +tVFS_Node *ATA_FindDir(tVFS_Node *UNUSED(Node), const char *Name) { int part; tATA_Disk *disk; @@ -316,8 +320,8 @@ Uint64 ATA_ReadFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) { int ret = DrvUtil_ReadBlock(Offset, Length, Buffer, ATA_ReadRaw, SECTOR_SIZE, disk); - Log("ATA_ReadFS: disk=%i, Offset=%lli, Length=%lli", disk, Offset, Length); - Debug_HexDump("ATA_ReadFS", Buffer, Length); + //Log("ATA_ReadFS: disk=%i, Offset=%lli, Length=%lli", disk, Offset, Length); + //Debug_HexDump("ATA_ReadFS", Buffer, Length); LEAVE('i', ret); return ret; }