From: John Hodge Date: Fri, 25 Sep 2009 02:44:03 +0000 (+0800) Subject: Fix Triplefault on task switch X-Git-Tag: rel0.06~521 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a3d9c32b28b6a6fd90a0b181a02def095eaaaec6;p=tpg%2Facess2.git Fix Triplefault on task switch --- diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index 2413a6e2..bdce0ca2 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -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