Author: tkreuzer
Date: Wed Nov 11 05:29:05 2009
New Revision: 44095
URL:
http://svn.reactos.org/svn/reactos?rev=44095&view=rev
Log:
Use the kernel mode address for the gdt/idt
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
[iso-8859-1] Wed Nov 11 05:29:05 2009
@@ -335,10 +335,13 @@
/* 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 */