case SYS_CLONE:
// Call clone system call
ret = Proc_Clone(Regs->Arg1);
+ Log("Proc_Clone returned %i", ret);
// Change user stack if a new stack address is passed
if(ret == 0 && Regs->Arg2)
Regs->StackPointer = Regs->Arg2;
Log_Debug("Threads", "Offsets of tThread");
Log_Debug("Threads", ".Priority = %i", offsetof(tThread, Priority));
+ Log_Debug("Threads", ".KernelStack = %i", offsetof(tThread, KernelStack));
// Create Initial Task
#if SCHEDULER_TYPE == SCHED_RR_PRI
tThread *cur = Proc_GetCurThread();
cur->bInstrTrace = 0;
Log_Warning("Threads", "Thread #%i committed a segfault at address %p", cur->TID, Addr);
- MM_DumpTables(0, KERNEL_BASE);
+ MM_DumpTables(0, USER_MAX);
Threads_Fault( 1 );
//Threads_Exit( 0, -1 );
}
}
// If we fall onto the same queue again, special handling is
// needed
- if( Last && i == Last->Priority ) {
+ if( Last && Last->Status == THREAD_STAT_ACTIVE && i == Last->Priority ) {
tThread *savedThread = thread;
// Find the next unscheduled thread in the list
else
{
MM_Map( mapping_dest, pb->PhysAddrs[pagenum - pb->BaseOffset] );
+ MM_RefPhys( pb->PhysAddrs[pagenum - pb->BaseOffset] );
LOG("Cached map %X to %p (%P)", pagenum*PAGE_SIZE, mapping_dest,
pb->PhysAddrs[pagenum - pb->BaseOffset]);
}