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);
// --- 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)
Debug_HexDump("ATA_ScanDisk", &mbr, 512);
#endif
- LEAVE('i', 0);
+ LEAVE('i', 1);
return 1;
}
}
/**
- * \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;
{
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;
}