From 9e6d4c89bfd9b5bdb132d58a1404524eed31d62a Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 4 Jul 2010 11:31:01 +0800 Subject: [PATCH] Enabled heaps of debug in ATA driver to try and solve Qemu issue --- Modules/Storage/ATA/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Modules/Storage/ATA/main.c b/Modules/Storage/ATA/main.c index de22df9e..8dc9f2a6 100644 --- a/Modules/Storage/ATA/main.c +++ b/Modules/Storage/ATA/main.c @@ -403,14 +403,17 @@ char *ATA_ReadDir(tVFS_Node *Node, int Pos) tVFS_Node *ATA_FindDir(tVFS_Node *Node, char *Name) { int part; + tATA_Disk *disk; + // Check first character if(Name[0] < 'A' || Name[0] > 'A'+MAX_ATA_DISKS) return NULL; + disk = &gATA_Disks[Name[0]-'A']; // Raw Disk if(Name[1] == '\0') { - if( gATA_Disks[Name[0]-'A'].Sectors == 0 ) + if( disk->Sectors == 0 && disk->Name[0] == '\0') return NULL; - return &gATA_Disks[Name[0]-'A'].Node; + return &disk->Node; } // Partitions @@ -418,7 +421,7 @@ tVFS_Node *ATA_FindDir(tVFS_Node *Node, char *Name) if(Name[2] == '\0') { // <= 9 part = Name[1] - '0'; part --; - return &gATA_Disks[Name[0]-'A'].Partitions[part].Node; + return &disk->Partitions[part].Node; } // > 9 if('0' > Name[2] || '9' < Name[2]) return NULL; @@ -427,7 +430,7 @@ tVFS_Node *ATA_FindDir(tVFS_Node *Node, char *Name) part = (Name[1] - '0') * 10; part += Name[2] - '0'; part --; - return &gATA_Disks[Name[0]-'A'].Partitions[part].Node; + return &disk->Partitions[part].Node; } -- 2.20.1