From 0c1b724e798d551d34c916e52f412c6a15978ead Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 1 Oct 2006 20:27:36 +0000 Subject: [PATCH] - 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 ;-) svn path=/trunk/; revision=24352 --- reactos/hal/halx86/generic/processor.c | 8 ++++---- reactos/include/ndk/ketypes.h | 4 ++++ reactos/ntoskrnl/kd/kdinit.c | 9 +++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/reactos/hal/halx86/generic/processor.c b/reactos/hal/halx86/generic/processor.c index f2b3a60d892..c93778751ff 100644 --- a/reactos/hal/halx86/generic/processor.c +++ b/reactos/hal/halx86/generic/processor.c @@ -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; diff --git a/reactos/include/ndk/ketypes.h b/reactos/include/ndk/ketypes.h index 6c8e9ce3f11..9ed3830f458 100644 --- a/reactos/include/ndk/ketypes.h +++ b/reactos/include/ndk/ketypes.h @@ -92,7 +92,11 @@ Author: // #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 diff --git a/reactos/ntoskrnl/kd/kdinit.c b/reactos/ntoskrnl/kd/kdinit.c index 26fed4a47f7..71655be72c2 100644 --- a/reactos/ntoskrnl/kd/kdinit.c +++ b/reactos/ntoskrnl/kd/kdinit.c @@ -168,6 +168,15 @@ KdInitSystem(ULONG BootPhase, 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) {