Author: ros-arm-bringup
Date: Mon Jul 27 02:52:44 2009
New Revision: 42251
URL: 
http://svn.reactos.org/svn/reactos?rev=42251&view=rev
Log:
- 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...
Modified:
    trunk/reactos/ntoskrnl/mm/mminit.c
    trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Mon Jul 27 02:52:44 2009
@@ -195,8 +195,13 @@
         /* 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 @@
         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;
-    }
-    else if (Phase == 2)
-    {
+
         /*
-        * Unmap low memory
-        */
+         * Unmap low memory
+         */
         MiInitBalancerThread();
-
+
         /*
-        * Initialise the modified page writer.
-        */
+         * Initialise the modified page writer.
+         */
         MmInitMpwThread();
-
+
         /* Initialize the balance set manager */
         MmInitBsmThread();
-
-        /* FIXME: Read parameters from memory */
+    }
+    else if (Phase == 2)
+    {
+
     }
     return TRUE;
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Mon Jul 27 02:52:44 2009
@@ -2328,6 +2328,8 @@
    ObjectTypeInitializer.CloseProcedure = MmpCloseSection;
    ObjectTypeInitializer.ValidAccessMask = SECTION_ALL_ACCESS;
    ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL,
&MmSectionObjectType);
+
+   MmCreatePhysicalMemorySection();
    return(STATUS_SUCCESS);
 }