From: John Hodge Date: Sat, 31 Jul 2010 15:48:08 +0000 (+0800) Subject: Debugging GPF in VFS (non-canoical addr) - Added catch for root mount failure X-Git-Tag: rel0.06~73 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3064ee4a12abf17bc88eea5f1b2bb5ad419889f6;p=tpg%2Facess2.git Debugging GPF in VFS (non-canoical addr) - Added catch for root mount failure --- diff --git a/Kernel/vfs/dir.c b/Kernel/vfs/dir.c index fbfc3af2..8e8234ca 100644 --- a/Kernel/vfs/dir.c +++ b/Kernel/vfs/dir.c @@ -2,7 +2,7 @@ * Acess2 VFS * - Directory Management Functions */ -#define DEBUG 0 +#define DEBUG 1 #include #include #include @@ -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) ) { diff --git a/Kernel/vfs/main.c b/Kernel/vfs/main.c index fa7273d5..eee0e10f 100644 --- a/Kernel/vfs/main.c +++ b/Kernel/vfs/main.c @@ -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", "");