Added debug to FAT driver, trying to fix a Real HW bug
authorJohn Hodge <[email protected]>
Wed, 14 Apr 2010 04:24:18 +0000 (12:24 +0800)
committerJohn Hodge <[email protected]>
Wed, 14 Apr 2010 04:24:18 +0000 (12:24 +0800)
Kernel/Makefile.BuildNum
Modules/Filesystems/FAT/fat.c

index dc8d809..1dbbbac 100644 (file)
@@ -1 +1 @@
-BUILD_NUM = 1822
+BUILD_NUM = 1830
index 3ec2a5f..2504526 100644 (file)
@@ -328,6 +328,8 @@ int FAT_int_GetAddress(tVFS_Node *Node, Uint64 Offset, Uint64 *Addr, Uint32 *Clu
                if(Cluster)     *Cluster = cluster;\r
        }\r
        \r
+       LOG("cluster = %08x", cluster);\r
+       \r
        // Bounds Checking (Used to spot corruption)\r
        if(cluster > disk->ClusterCount + 2)\r
        {\r
@@ -976,6 +978,7 @@ int FAT_int_ReadDirSector(tVFS_Node *Node, int Sector, fat_filetable *Buffer)
                return 1;\r
        }\r
        \r
+       LOG("addr = 0x%llx", addr);\r
        // Read Sector\r
        if(VFS_ReadAt(disk->fileHandle, addr, 512, Buffer) != 512)\r
        {\r
@@ -1106,6 +1109,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
        \r
        if(FAT_int_ReadDirSector(Node, ID/16, fileinfo))\r
        {\r
+               LOG("End of chain, end of dir");\r
                LEAVE('n');\r
                return NULL;\r
        }\r
@@ -1113,9 +1117,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
        // Offset in sector\r
        a = ID % 16;\r
 \r
-       LOG("a = %i", a);\r
-       \r
-       LOG("name[0] = 0x%x", (Uint8)fileinfo[a].name[0]);\r
+       LOG("fileinfo[%i].name[0] = 0x%x", a, (Uint8)fileinfo[a].name[0]);\r
        \r
        // Check if this is the last entry\r
        if( fileinfo[a].name[0] == '\0' ) {\r
@@ -1128,8 +1130,10 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
        // Check for empty entry\r
        if( (Uint8)fileinfo[a].name[0] == 0xE5 ) {\r
                LOG("Empty Entry");\r
-               LEAVE('p', VFS_SKIP);\r
-               return VFS_SKIP;        // Skip\r
+               //LEAVE('p', VFS_SKIP);\r
+               //return VFS_SKIP;      // Skip\r
+               LEAVE('n');\r
+               return NULL;    // Skip\r
        }\r
        \r
        #if USE_LFN\r

UCC git Repository :: git.ucc.asn.au