Added magic breakpoint to SYS_CLONE, cleaned up other debug
authorJohn Hodge <[email protected]>
Sun, 27 Sep 2009 03:40:17 +0000 (11:40 +0800)
committerJohn Hodge <[email protected]>
Sun, 27 Sep 2009 03:40:17 +0000 (11:40 +0800)
Kernel/arch/x86/proc.c
Kernel/syscalls.c
Kernel/threads.c

index 336bcdb..d468d11 100644 (file)
@@ -298,7 +298,6 @@ int Proc_Clone(Uint *Err, Uint Flags)
        newThread->SavedState.EBP = ebp;
        eip = GetEIP();
        if(eip == SWITCH_MAGIC) {
-               Log("Thread %i running", Proc_GetCurThread()->TID);
                outb(0x20, 0x20);       // ACK Timer and return as child
                return 0;
        }
index 1eee53b..b9473f9 100644 (file)
@@ -57,7 +57,8 @@ void SyscallHandler(tSyscallRegs *Regs)
        case SYS_CLONE:
                // Call clone system call
                ret = Proc_Clone(&err, Regs->Arg1);
-               Log("ret = %i");
+               Log("ret = %i", ret);
+               __asm__ __volatile__("xchg %bx, %bx");
                // Change user stack if requested
                if(ret == 0 && !(Regs->Arg1 & CLONE_VM))
                        Regs->StackPointer = Regs->Arg2;
index 714b2b0..da65596 100644 (file)
@@ -93,10 +93,11 @@ void Threads_Init()
                cur->ThreadName = "Idle Thread";
                Threads_SetTickets(0);  // Never called randomly
                cur->Quantum = 1;       // 1 slice quantum
+               HALT();
                for(;;) {
-                       Log("---- Idle");
-                       Threads_Dump();
-                       __asm__ __volatile__ ("hlt");   // Just yeilds
+                       //Log("---- Idle");
+                       //Threads_Dump();
+                       HALT(); // Just yeilds
                }
        }
        #endif

UCC git Repository :: git.ucc.asn.au