CR3 is PHYSICAL not VIRTUAL
[tpg/acess2.git] / Kernel / arch / x86 / proc.c
index 2413a6e..bb93bfc 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 - KERNEL_BASE;
+       #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