Use the kernel mode address for the gdt/idt

svn path=/branches/ros-amd64-bringup/; revision=44095
This commit is contained in:
Timo Kreuzer
2009-11-11 04:29:05 +00:00
parent d3d5631e62
commit 2e92cb2a4c
@@ -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 */