Fix Triplefault on task switch
authorJohn Hodge <[email protected]>
Fri, 25 Sep 2009 02:44:03 +0000 (10:44 +0800)
committerJohn Hodge <[email protected]>
Fri, 25 Sep 2009 02:44:03 +0000 (10:44 +0800)
Kernel/arch/x86/proc.c

index 2413a6e..bdce0ca 100644 (file)
@@ -131,6 +131,14 @@ void ArchThreads_Init()
        gCurrentThread = &gThreadZero;
        #endif
        
+       #if USE_PAE
+       gThreadZero.MemState.PDP[0] = 0;
+       gThreadZero.MemState.PDP[1] = 0;
+       gThreadZero.MemState.PDP[2] = 0;
+       #else
+       gThreadZero.MemState.CR3 = (Uint)gaInitPageDir;
+       #endif
+       
        // Set timer frequency
        outb(0x43, 0x34);       // Set Channel 0, Low/High, Rate Generator
        outb(0x40, TIMER_DIVISOR&0xFF); // Low Byte of Divisor

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