Debugging GPF in VFS (non-canoical addr) - Added catch for root mount failure
authorJohn Hodge <[email protected]>
Sat, 31 Jul 2010 15:48:08 +0000 (23:48 +0800)
committerJohn Hodge <[email protected]>
Sat, 31 Jul 2010 15:48:08 +0000 (23:48 +0800)
Kernel/vfs/dir.c
Kernel/vfs/main.c

index fbfc3af..8e8234c 100644 (file)
@@ -2,7 +2,7 @@
  * Acess2 VFS
  * - Directory Management Functions
  */
-#define DEBUG  0
+#define DEBUG  1
 #include <acess.h>
 #include <vfs.h>
 #include <vfs_int.h>
@@ -61,7 +61,12 @@ int VFS_MkNod(char *Path, Uint Flags)
        else
                parent = VFS_ParsePath(absPath, NULL);
        
-       if(!parent)     return -1;      // Error Check
+       LOG("parent = %p", parent);
+       
+       if(!parent) {
+               LEAVE('i', -1);
+               return -1;      // Error Check
+       }
        
        // Permissions Check
        if( !VFS_CheckACL(parent, VFS_PERM_EXECUTE|VFS_PERM_WRITE) ) {
index fa7273d..eee0e10 100644 (file)
@@ -49,7 +49,10 @@ int VFS_Init(void)
        giVFS_MountFileID = SysFS_RegisterFile("VFS/Mounts", NULL, 0);
        giVFS_DriverFileID = SysFS_RegisterFile("VFS/Drivers", NULL, 0);
        
-       VFS_Mount("root", "/", "rootfs", "");
+       if( VFS_Mount("root", "/", "rootfs", "") != 0 ) {
+               Panic("Unable to mount root (Where the **** is rootfs?)");
+               return -1;
+       }
        VFS_MkDir("/Devices");
        VFS_MkDir("/Mount");
        VFS_Mount("dev", "/Devices", "devfs", "");

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