Use the kernel mode address for the gdt/idt
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 11 Nov 2009 04:29:05 +0000 (04:29 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 11 Nov 2009 04:29:05 +0000 (04:29 +0000)
svn path=/branches/ros-amd64-bringup/; revision=44095

reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c

index dd123d5..c5f55ca 100644 (file)
@@ -335,10 +335,13 @@ WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG64 Pcr, IN ULONG64 Tss)
        /* Set the new PML4 */
        __writecr3((ULONGLONG)pPML4);
 
-       RtlZeroMemory(GdtIdt, PAGE_SIZE);
+    /* Get kernel mode address of gdt / idt */
+       GdtIdt = (PVOID)((LONG64)GdtIdt + KSEG0_BASE);
 
+    /* Create gdt entries and load gdtr */
     WinLdrSetupGdt(GdtIdt, Tss);
 
+    /* Copy old Idt and set idtr */
     WinLdrSetupIdt((PVOID)((ULONG64)GdtIdt + 2048)); // HACK!
 
     /* LDT is unused */