[ros-diffs] [ion] 24352: - Un-optimize KeGetPcr and make it use fs:20h instead of hard-coding the 0xFF.... address, because someone decided that ROS should have a different KPCR address then NT. - This gets NTLDR working with ReactOS and I can boot all the way to MmInit1 (which fails due to missing KeMemoryMap & freeldr data). - Serial port output works with DPRINT1 as well ; -)

ion at svn.reactos.org ion at svn.reactos.org
Sun Oct 1 22:27:39 CEST 2006


Author: ion
Date: Mon Oct  2 00:27:36 2006
New Revision: 24352

URL: http://svn.reactos.org/svn/reactos?rev=24352&view=rev
Log:
- Un-optimize KeGetPcr and make it use fs:20h instead of hard-coding the 0xFF.... address, because someone decided that ROS should have a different KPCR address then NT.
- This gets NTLDR working with ReactOS and I can boot all the way to MmInit1 (which fails due to missing KeMemoryMap & freeldr data).
- Serial port output works with DPRINT1 as well ;-)

Modified:
    trunk/reactos/hal/halx86/generic/processor.c
    trunk/reactos/include/ndk/ketypes.h
    trunk/reactos/ntoskrnl/kd/kdinit.c

Modified: trunk/reactos/hal/halx86/generic/processor.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/processor.c?rev=24352&r1=24351&r2=24352&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/processor.c (original)
+++ trunk/reactos/hal/halx86/generic/processor.c Mon Oct  2 00:27:36 2006
@@ -20,11 +20,11 @@
 
 /* FUNCTIONS *****************************************************************/
 
-VOID STDCALL
-HalInitializeProcessor(ULONG ProcessorNumber,
-                       PLOADER_PARAMETER_BLOCK LoaderBlock)
+VOID
+NTAPI
+HalInitializeProcessor(IN ULONG ProcessorNumber,
+                       IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 {
-  DPRINT("HalInitializeProcessor(%lu %p)\n", ProcessorNumber, LoaderBlock);
     /* Set default IDR */
     KeGetPcr()->IDR = 0xFFFFFFFB;
     KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;

Modified: trunk/reactos/include/ndk/ketypes.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=24352&r1=24351&r2=24352&view=diff
==============================================================================
--- trunk/reactos/include/ndk/ketypes.h (original)
+++ trunk/reactos/include/ndk/ketypes.h Mon Oct  2 00:27:36 2006
@@ -92,7 +92,11 @@
 //
 #define K0IPCR                          ((ULONG_PTR)(KIP0PCRADDRESS))
 #define PCR                             ((volatile KPCR * const)K0IPCR)
+#ifdef _WE_USE_THE_SAME_PCR_ADDRESS
 #define KeGetPcr()                      PCR
+#else
+#define KeGetPcr()                      ((volatile KPCR * const)__readfsdword(0x1C))
+#endif
 
 //
 // Number of dispatch codes supported by KINTERRUPT

Modified: trunk/reactos/ntoskrnl/kd/kdinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdinit.c?rev=24352&r1=24351&r2=24352&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/kd/kdinit.c (original)
+++ trunk/reactos/ntoskrnl/kd/kdinit.c Mon Oct  2 00:27:36 2006
@@ -168,6 +168,15 @@
     ULONG i;
     PCHAR p1, p2;
 
+#if 0
+    /* NTLDR HACK */
+    KdpSerialInit(&DispatchTable[KdSerial], 0);
+    KdpDebugMode.Serial = TRUE;
+    SerialPortInfo.ComPort = 1;
+    KdpPort = 1;
+    KdDebuggerEnabled = TRUE;
+#endif
+
     /* Set Default Port Options */
     if (BootPhase == 0)
     {




More information about the Ros-diffs mailing list