Author: ion Date: Sun Oct 1 23:43:18 2006 New Revision: 24351
URL: http://svn.reactos.org/svn/reactos?rev=24351&view=rev Log: - Do MmInit1 in KiInitializeKernel so we can access SharedUserData from it (we'll need to setup the CPU Features there). - Cleanup some external/prototype mess and put them nicely into headers.
Modified: trunk/reactos/ntoskrnl/ex/init.c trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/include/internal/ps.h trunk/reactos/ntoskrnl/ke/clock.c trunk/reactos/ntoskrnl/ke/i386/kiinit.c
Modified: trunk/reactos/ntoskrnl/ex/init.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=2435... ============================================================================== --- trunk/reactos/ntoskrnl/ex/init.c (original) +++ trunk/reactos/ntoskrnl/ex/init.c Sun Oct 1 23:43:18 2006 @@ -24,35 +24,18 @@ ULONG NtBuildNumber = KERNEL_VERSION_BUILD; ULONG NtGlobalFlag = 0;
-ULONG InitSafeBootMode = 0; /* KB83764 */ - extern ULONG MmCoreDumpType; -extern CHAR KiTimerSystemAuditing; -extern PVOID Ki386InitialStackArray[MAXIMUM_PROCESSORS]; -extern ADDRESS_RANGE KeMemoryMap[64]; -extern ULONG KeMemoryMapRangeCount; -extern ULONG_PTR FirstKrnlPhysAddr; -extern ULONG_PTR LastKrnlPhysAddr; -extern ULONG_PTR LastKernelAddress; extern LOADER_MODULE KeLoaderModules[64]; extern ULONG KeLoaderModuleCount; extern PRTL_MESSAGE_RESOURCE_DATA KiBugCodeMessages; - BOOLEAN NoGuiBoot = FALSE; -static BOOLEAN BootLog = FALSE; -static ULONG MaxMem = 0; static BOOLEAN ForceAcpiDisable = FALSE; - -BOOLEAN -NTAPI -PspInitPhase0( - VOID -);
/* Init flags and settings */ ULONG ExpInitializationPhase; BOOLEAN ExpInTextModeSetup; BOOLEAN IoRemoteBootClient; +ULONG InitSafeBootMode;
/* Boot NLS information */ PVOID ExpNlsTableBase; @@ -251,9 +234,7 @@ __inline VOID STDCALL -ParseCommandLine(PULONG MaxMem, - PBOOLEAN NoGuiBoot, - PBOOLEAN BootLog, +ParseCommandLine(PBOOLEAN NoGuiBoot, PBOOLEAN ForceAcpiDisable) { PCHAR p1, p2; @@ -262,26 +243,7 @@ while(*p1 && (p2 = strchr(p1, '/'))) {
p2++; - if (!_strnicmp(p2, "MAXMEM", 6)) { - - p2 += 6; - while (isspace(*p2)) p2++; - - if (*p2 == '=') { - - p2++; - - while(isspace(*p2)) p2++; - - if (isdigit(*p2)) { - while (isdigit(*p2)) { - *MaxMem = *MaxMem * 10 + *p2 - '0'; - p2++; - } - break; - } - } - } else if (!_strnicmp(p2, "NOGUIBOOT", 9)) { + if (!_strnicmp(p2, "NOGUIBOOT", 9)) {
p2 += 9; *NoGuiBoot = TRUE; @@ -301,10 +263,6 @@ MmCoreDumpType = MM_CORE_DUMP_TYPE_NONE; } } - } else if (!_strnicmp(p2, "BOOTLOG", 7)) { - - p2 += 7; - *BootLog = TRUE; } else if (!_strnicmp(p2, "NOACPI", 6)) {
p2 += 6; @@ -514,19 +472,8 @@ { PNLS_DATA_BLOCK NlsData;
- /* Initialize Kernel Memory Address Space */ - MmInit1(FirstKrnlPhysAddr, - LastKrnlPhysAddr, - LastKernelAddress, - (PADDRESS_RANGE)&KeMemoryMap, - KeMemoryMapRangeCount, - MaxMem > 8 ? MaxMem : 4096); - - /* Sets up the Text Sections of the Kernel and HAL for debugging */ - LdrInit1(); - /* Parse Command Line Settings */ - ParseCommandLine(&MaxMem, &NoGuiBoot, &BootLog, &ForceAcpiDisable); + ParseCommandLine(&NoGuiBoot, &ForceAcpiDisable);
/* FIXME: Deprecate soon */ ParseAndCacheLoadedModules(); @@ -726,7 +673,7 @@ DbgBreakPoint();
/* Setup Drivers and Root Device Node */ - IoInit2(BootLog); + IoInit2(FALSE);
/* Display the boot screen image if not disabled */ if (!NoGuiBoot) InbvEnableBootDriver(TRUE); @@ -826,7 +773,6 @@ }
/* Enable the Clock, close remaining handles */ - KiTimerSystemAuditing = 1; ZwClose(ThreadHandle); ZwClose(ProcessHandle);
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/k... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h Sun Oct 1 23:43:18 2006 @@ -66,6 +66,12 @@ struct _KPCR; struct _KPRCB; struct _KEXCEPTION_FRAME; + +extern ADDRESS_RANGE KeMemoryMap[64]; +extern ULONG KeMemoryMapRangeCount; +extern ULONG_PTR FirstKrnlPhysAddr; +extern ULONG_PTR LastKrnlPhysAddr; +extern ULONG_PTR LastKernelAddress;
extern PVOID KeUserApcDispatcher; extern PVOID KeUserCallbackDispatcher;
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/p... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ps.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ps.h Sun Oct 1 23:43:18 2006 @@ -76,6 +76,12 @@ VOID NTAPI PspShutdownProcessManager( + VOID +); + +BOOLEAN +NTAPI +PspInitPhase0( VOID );
Modified: trunk/reactos/ntoskrnl/ke/clock.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/clock.c?rev=243... ============================================================================== --- trunk/reactos/ntoskrnl/ke/clock.c (original) +++ trunk/reactos/ntoskrnl/ke/clock.c Sun Oct 1 23:43:18 2006 @@ -35,7 +35,6 @@ LARGE_INTEGER SystemBootTime = { 0 }; #endif
-CHAR KiTimerSystemAuditing = 0; KDPC KiExpireTimerDpc; BOOLEAN KiClockSetupComplete = FALSE;
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Sun Oct 1 23:43:18 2006 @@ -11,7 +11,6 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> -#include <intrin.h>
/* GLOBALS *******************************************************************/
@@ -164,6 +163,17 @@ DPRINT1("SMP Boot support not yet present\n"); }
+ /* Initialize Kernel Memory Address Space */ + MmInit1(FirstKrnlPhysAddr, + LastKrnlPhysAddr, + LastKernelAddress, + (PADDRESS_RANGE)&KeMemoryMap, + KeMemoryMapRangeCount, + 4096); + + /* Sets up the Text Sections of the Kernel and HAL for debugging */ + LdrInit1(); + /* Setup the Idle Thread */ KeInitializeThread(InitProcess, InitThread,