X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Farch%2Fx86%2Fproc.c;h=2869c3c3ec36748b2f5f68717bf3f2c348e8062c;hb=2462d860630674d10d554f86aa669163f6f2db6b;hp=3119ada1665caa6c5bf75ef4dd5db302ac2c47dd;hpb=d8976435eade14e409b01e58850b75990ad9a4a7;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/arch/x86/proc.c b/KernelLand/Kernel/arch/x86/proc.c index 3119ada1..2869c3c3 100644 --- a/KernelLand/Kernel/arch/x86/proc.c +++ b/KernelLand/Kernel/arch/x86/proc.c @@ -1,7 +1,11 @@ /* - * AcessOS Microkernel Version + * Acess2 Kernel (x86) + * - By John Hodge (thePowersGang) + * * proc.c + * - Low level thread management */ +#define DEBUG 0 #include #include #include @@ -505,11 +509,12 @@ tPID Proc_Clone(Uint Flags) */ tThread *Proc_SpawnWorker(void (*Fcn)(void*), void *Data) { - tThread *new; Uint stack_contents[4]; + LOG("(Fcn=%p,Data=%p)", Fcn, Data); // Create new thread - new = Threads_CloneThreadZero(); + tThread *new = Threads_CloneThreadZero(); + LOG("new=%p", new); if(!new) { Warning("Proc_SpawnWorker - Out of heap space!\n"); return NULL; @@ -523,6 +528,7 @@ tThread *Proc_SpawnWorker(void (*Fcn)(void*), void *Data) // Create a new worker stack (in PID0's address space) new->KernelStack = MM_NewWorkerStack(stack_contents, sizeof(stack_contents)); + LOG("new->KernelStack = %p", new->KernelStack); // Save core machine state new->SavedState.ESP = new->KernelStack - sizeof(stack_contents); @@ -533,6 +539,7 @@ tThread *Proc_SpawnWorker(void (*Fcn)(void*), void *Data) // Mark as active new->Status = THREAD_STAT_PREINIT; Threads_AddActive( new ); + LOG("Added to active"); return new; }