Author: dgorbachev
Date: Wed Mar 11 23:34:34 2009
New Revision: 39959
URL:
http://svn.reactos.org/svn/reactos?rev=39959&view=rev
Log:
Do not crash on Pentium.
Modified:
trunk/reactos/hal/halx86/generic/bios.c
Modified: trunk/reactos/hal/halx86/generic/bios.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bios.c?…
==============================================================================
--- trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] Wed Mar 11 23:34:34 2009
@@ -107,6 +107,17 @@
HalpSwitchToRealModeTrapHandlers(VOID)
{
ULONG Handler;
+ PHARDWARE_PTE IdtPte;
+
+ /* On i586, the first 7 entries of IDT are write-protected, unprotect them. */
+ if (KeGetCurrentPrcb()->CpuType == 5)
+ {
+ IdtPte = GetPteAddress(((PKIPCR)KeGetPcr())->IDT);
+ IdtPte->Write = 1;
+
+ /* Flush the TLB by resetting CR3 */
+ __writecr3(__readcr3());
+ }
/* Save the current Invalid Opcode and General Protection Fault Handlers */
HalpGpfHandler = ((((PKIPCR)KeGetPcr())->IDT[13].ExtendedOffset << 16)
&