From 2e92cb2a4c8294f58681465a96f4200e61eefff9 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 11 Nov 2009 04:29:05 +0000 Subject: [PATCH] Use the kernel mode address for the gdt/idt svn path=/branches/ros-amd64-bringup/; revision=44095 --- reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c b/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c index dd123d5cdc3..c5f55cab69f 100644 --- a/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c +++ b/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c @@ -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 */