From: John Hodge Date: Wed, 14 Apr 2010 04:24:18 +0000 (+0800) Subject: Added debug to FAT driver, trying to fix a Real HW bug X-Git-Tag: rel0.06~241 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=c2b379365a535038f95ab98da010aa1b91a4d3f9;p=tpg%2Facess2.git Added debug to FAT driver, trying to fix a Real HW bug --- diff --git a/Kernel/Makefile.BuildNum b/Kernel/Makefile.BuildNum index dc8d8096..1dbbbac2 100644 --- a/Kernel/Makefile.BuildNum +++ b/Kernel/Makefile.BuildNum @@ -1 +1 @@ -BUILD_NUM = 1822 +BUILD_NUM = 1830 diff --git a/Modules/Filesystems/FAT/fat.c b/Modules/Filesystems/FAT/fat.c index 3ec2a5fd..25045268 100644 --- a/Modules/Filesystems/FAT/fat.c +++ b/Modules/Filesystems/FAT/fat.c @@ -328,6 +328,8 @@ int FAT_int_GetAddress(tVFS_Node *Node, Uint64 Offset, Uint64 *Addr, Uint32 *Clu if(Cluster) *Cluster = cluster; } + LOG("cluster = %08x", cluster); + // Bounds Checking (Used to spot corruption) if(cluster > disk->ClusterCount + 2) { @@ -976,6 +978,7 @@ int FAT_int_ReadDirSector(tVFS_Node *Node, int Sector, fat_filetable *Buffer) return 1; } + LOG("addr = 0x%llx", addr); // Read Sector if(VFS_ReadAt(disk->fileHandle, addr, 512, Buffer) != 512) { @@ -1106,6 +1109,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) if(FAT_int_ReadDirSector(Node, ID/16, fileinfo)) { + LOG("End of chain, end of dir"); LEAVE('n'); return NULL; } @@ -1113,9 +1117,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) // Offset in sector a = ID % 16; - LOG("a = %i", a); - - LOG("name[0] = 0x%x", (Uint8)fileinfo[a].name[0]); + LOG("fileinfo[%i].name[0] = 0x%x", a, (Uint8)fileinfo[a].name[0]); // Check if this is the last entry if( fileinfo[a].name[0] == '\0' ) { @@ -1128,8 +1130,10 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) // Check for empty entry if( (Uint8)fileinfo[a].name[0] == 0xE5 ) { LOG("Empty Entry"); - LEAVE('p', VFS_SKIP); - return VFS_SKIP; // Skip + //LEAVE('p', VFS_SKIP); + //return VFS_SKIP; // Skip + LEAVE('n'); + return NULL; // Skip } #if USE_LFN