X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fsystem.c;h=db7da340ed79265e63bb29ffe67d336fcb3ab5b0;hb=cb414d6f5f9730d64b4914e45c14d9c16aea0b6c;hp=8fc2a1ccea4f8e7348f0a44d9c9bb909452da3fd;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/system.c b/KernelLand/Kernel/system.c index 8fc2a1cc..db7da340 100644 --- a/KernelLand/Kernel/system.c +++ b/KernelLand/Kernel/system.c @@ -6,12 +6,14 @@ */ #define DEBUG 0 #include +#include // === IMPORTS === extern void Arch_LoadBootModules(void); extern int Modules_LoadBuiltins(void); extern void Modules_SetBuiltinParams(char *Name, char *ArgString); extern void Debug_SetKTerminal(const char *File); +extern void Timer_CallbackThread(void *); // === PROTOTYPES === void System_Init(char *Commandline); @@ -29,6 +31,8 @@ char *argv[32]; // === CODE === void System_Init(char *CommandLine) { + Proc_SpawnWorker(Timer_CallbackThread, NULL); + // Parse Kernel's Command Line System_ParseCommandLine(CommandLine); @@ -41,7 +45,12 @@ void System_Init(char *CommandLine) // - Execute the Config Script Log_Log("Config", "Spawning init '%s'", gsInitBinary); - Proc_Spawn(gsInitBinary); + if(Proc_Clone(CLONE_VM|CLONE_NOUSER) == 0) + { + const char *args[] = {gsInitBinary, 0}; + Proc_Execve(gsInitBinary, args, &args[1], 0); + Log_KernelPanic("System", "Unable to spawn init '%s'", gsInitBinary); + } // Set the debug to be echoed to the terminal Log_Log("Config", "Kernel now echoes to VT7 (Ctrl-Alt-F8)");