Author: fireball
Date: Wed Oct 10 16:39:54 2007
New Revision: 29477
URL:
http://svn.reactos.org/svn/reactos?rev=29477&view=rev
Log:
- Copy kernel's IDT entries to the IDT we've got from the bootloader. Fixes
boot-process initiated by ntldr-compatible loaders.
Modified:
trunk/reactos/ntoskrnl/ke/i386/kiinit.c
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Wed Oct 10 16:39:54 2007
@@ -661,6 +661,7 @@
ULONG InitialStack;
PKGDTENTRY Gdt;
PKIDTENTRY Idt;
+ KIDTENTRY NmiEntry, DoubleFaultEntry;
PKTSS Tss;
PKIPCR Pcr;
@@ -722,6 +723,19 @@
Ke386SetDs(KGDT_R3_DATA | RPL_MASK);
Ke386SetEs(KGDT_R3_DATA | RPL_MASK);
+ /* Save NMI and double fault traps */
+ RtlCopyMemory(&NmiEntry, &Idt[2], sizeof(KIDTENTRY));
+ RtlCopyMemory(&DoubleFaultEntry, &Idt[8], sizeof(KIDTENTRY));
+
+ /* Copy kernel's trap handlers */
+ RtlCopyMemory(Idt,
+ (PVOID)KiIdtDescriptor.Base,
+ KiIdtDescriptor.Limit + 1);
+
+ /* Restore NMI and double fault */
+ RtlCopyMemory(&Idt[2], &NmiEntry, sizeof(KIDTENTRY));
+ RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY));
+
AppCpuInit:
/* Loop until we can release the freeze lock */
do