From 059da34e933aaa7f0184480e1053337310583e65 Mon Sep 17 00:00:00 2001 From: ReactOS Portable Systems Group Date: Mon, 27 Jul 2009 00:52:44 +0000 Subject: [PATCH] - Create \dev\physmem section during section initialization, not later. - Setup SharedUserData settings during Phase 0, not Phase 1. Fixes an old bug where the Inbv driver assumed ReactOS was in "server mode" simply because the default SharedUserData->NtProductType was "0" (which is an invalid product type, but it's != NtProductTypeNt). - Also fixed it such that this reports NtProductServer, which is what ReactOS reports to be (Windows 2003 Server SP 1). - Initialize the modified page writer and balancer thread in phase 1, not phase 2. - Phase 2 should make the executive pageable, but I don't think this is supported yet... svn path=/trunk/; revision=42251 --- reactos/ntoskrnl/mm/mminit.c | 44 ++++++++++++++++------------------- reactos/ntoskrnl/mm/section.c | 2 ++ 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index b6eaf4d0e15..b6702b18406 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -195,8 +195,13 @@ MmInitSystem(IN ULONG Phase, /* Initialize the loaded module list */ MiInitializeLoadedModuleList(LoaderBlock); - /* We're done, for now */ - DPRINT("Mm0: COMPLETE\n"); + /* Setup shared user data settings that NT does as well */ + ASSERT(SharedUserData->NumberOfPhysicalPages == 0); + SharedUserData->NumberOfPhysicalPages = MmStats.NrTotalPages; + SharedUserData->LargePageMinimum = 0; + + /* For now, we assume that we're always Server */ + SharedUserData->NtProductType = NtProductServer; } else if (Phase == 1) { @@ -204,32 +209,23 @@ MmInitSystem(IN ULONG Phase, MmInitializePageOp(); MmInitSectionImplementation(); MmInitPagingFile(); - MmCreatePhysicalMemorySection(); - - /* Setup shared user data settings that NT does as well */ - ASSERT(SharedUserData->NumberOfPhysicalPages == 0); - SharedUserData->NumberOfPhysicalPages = MmStats.NrTotalPages; - SharedUserData->LargePageMinimum = 0; - - /* For now, we assume that we're always Workstation */ - SharedUserData->NtProductType = NtProductWinNt; + + /* + * Unmap low memory + */ + MiInitBalancerThread(); + + /* + * Initialise the modified page writer. + */ + MmInitMpwThread(); + + /* Initialize the balance set manager */ + MmInitBsmThread(); } else if (Phase == 2) { - /* - * Unmap low memory - */ - MiInitBalancerThread(); - /* - * Initialise the modified page writer. - */ - MmInitMpwThread(); - - /* Initialize the balance set manager */ - MmInitBsmThread(); - - /* FIXME: Read parameters from memory */ } return TRUE; diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 5635e8ed768..54393c1b941 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -2328,6 +2328,8 @@ MmInitSectionImplementation(VOID) ObjectTypeInitializer.CloseProcedure = MmpCloseSection; ObjectTypeInitializer.ValidAccessMask = SECTION_ALL_ACCESS; ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &MmSectionObjectType); + + MmCreatePhysicalMemorySection(); return(STATUS_SUCCESS); }