X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FStorage%2FATA%2Fmain.c;h=7f8964d2af9be3dd300f0179da6eae26e80d7191;hb=4f1a9b430a3fa57bbe52a6a2fe546f6fe93c389d;hp=05caaab04bdcc86bfe364b377140f09aa77b8529;hpb=b00c9161c75b0ef6a1de3b7b15444a783afe8a86;p=tpg%2Facess2.git diff --git a/Modules/Storage/ATA/main.c b/Modules/Storage/ATA/main.c index 05caaab0..7f8964d2 100644 --- a/Modules/Storage/ATA/main.c +++ b/Modules/Storage/ATA/main.c @@ -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;