X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fmodules.c;h=44c4cb518fb77cd44f43102f61484e9b08f8218f;hb=02dd2b97e3f4e8d52e49be1f2c90cdbc04545237;hp=71d76d4cee14c7e6d611ad2c1255ebb7a6f1aa61;hpb=3c777e58e6baba6760f43b8fdde4daf62081048b;p=tpg%2Facess2.git diff --git a/Kernel/modules.c b/Kernel/modules.c index 71d76d4c..44c4cb51 100644 --- a/Kernel/modules.c +++ b/Kernel/modules.c @@ -6,6 +6,7 @@ #include // === PROTOTYPES === + int Modules_LoadBuiltins(); int Module_LoadMem(void *Buffer, Uint Length, char *ArgString); int Module_LoadFile(char *Path, char *ArgString); int Module_int_ResolveDeps(tModule *Info); @@ -64,6 +65,8 @@ int Modules_LoadBuiltins() for( i = 0; i < giNumBuiltinModules; i++ ) { if( baIsLoaded[i] ) continue; // Ignore already loaded modules + + deps = gKernelModules[i].Dependencies; if( deps ) { @@ -95,9 +98,13 @@ int Modules_LoadBuiltins() gKernelModules[i].Name, gKernelModules[i].Version>>8, gKernelModules[i].Version & 0xFF ); - gKernelModules[i].Init(NULL); + if( gKernelModules[i].Init(NULL) == 0 ) { + Log("Loading Failed, all modules that depend on this will also fail"); + baIsLoaded[i] = -1; + } // Mark as loaded - baIsLoaded[i] = 1; + else + baIsLoaded[i] = 1; numToInit --; } } @@ -113,7 +120,7 @@ int Module_LoadMem(void *Buffer, Uint Length, char *ArgString) { char path[VFS_MEMPATH_SIZE]; - VFS_GetMemPath(Buffer, Length, path); + VFS_GetMemPath(path, Buffer, Length); return Module_LoadFile( path, ArgString ); } @@ -175,6 +182,12 @@ int Module_LoadFile(char *Path, char *ArgString) return 0; } + Log("Initialising %p '%s' v%i.%i...", + info, + info->Name, + info->Version>>8, info->Version & 0xFF + ); + // Call Initialiser //if( info->Init( ArgString ) != 0 ) if( info->Init( NULL ) == 0 )