[ros-diffs] [ros-arm-bringup] 32373: Christ! Don't zero out the shared memory page during Virtual Memory initialization! The page is already well in-use by the time we were zeroing it out, and this is also the reason why all the attempts to move MmInit1 into MmInitSystem had previously failed -- the NtSystemRoot path would get written during initialization (But before MmInitSystem), and MmInit1 would then zero out the entire structure. Not only does this allow us to do MmInit1 in MmInitSystem, where it should be, but it also fixes the fact that several KUSER_SHARED_DATA flags were being zeroed out. As an added benefit, ARM/PPC ports now need to worry about Mm much later then before (well after the HAL has initialized and interrupts are enabled).

ros-arm-bringup at svn.reactos.org ros-arm-bringup at svn.reactos.org
Fri Feb 15 07:50:00 CET 2008


Author: ros-arm-bringup
Date: Fri Feb 15 09:49:59 2008
New Revision: 32373

URL: http://svn.reactos.org/svn/reactos?rev=32373&view=rev
Log:
Christ! Don't zero out the shared memory page during Virtual Memory initialization! The page is already well in-use by the time we were zeroing it out, and this is also the reason why all the attempts to move MmInit1 into MmInitSystem had previously failed -- the NtSystemRoot path would get written during initialization (But before MmInitSystem), and MmInit1 would then zero out the entire structure.
Not only does this allow us to do MmInit1 in MmInitSystem, where it should be, but it also fixes the fact that several KUSER_SHARED_DATA flags were being zeroed out.
As an added benefit, ARM/PPC ports now need to worry about Mm much later then before (well after the HAL has initialized and interrupts are enabled).


Modified:
    trunk/reactos/ntoskrnl/ex/init.c
    trunk/reactos/ntoskrnl/ke/i386/kiinit.c
    trunk/reactos/ntoskrnl/mm/mminit.c

Modified: trunk/reactos/ntoskrnl/ex/init.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=32373&r1=32372&r2=32373&view=diff
==============================================================================
    (empty)

Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?rev=32373&r1=32372&r2=32373&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Fri Feb 15 09:49:59 2008
@@ -536,9 +536,6 @@
     /* HACK for MmUpdatePageDir */
     ((PETHREAD)InitThread)->ThreadsProcess = (PEPROCESS)InitProcess;
 
-    /* Initialize Kernel Memory Address Space */
-    MmInit1();
-
     /* Set basic CPU Features that user mode can read */
     SharedUserData->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] =
         (KeFeatureBits & KF_MMX) ? TRUE: FALSE;

Modified: trunk/reactos/ntoskrnl/mm/mminit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=32373&r1=32372&r2=32373&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mminit.c (original)
+++ trunk/reactos/ntoskrnl/mm/mminit.c Fri Feb 15 09:49:59 2008
@@ -182,7 +182,6 @@
                       0,
                       BoundaryAddressMultiple);
    MmSharedDataPagePhysicalAddress.QuadPart = 2 << PAGE_SHIFT;
-   RtlZeroMemory(BaseAddress, Length);
 
    /*
     *
@@ -420,6 +419,9 @@
     ULONG Flags = 0;
     if (Phase == 0)
     {
+        /* Initialize Mm bootstrap */
+        MmInit1();
+
         /* Initialize the Loader Lock */
         KeInitializeMutant(&MmSystemLoadLock, FALSE);
 




More information about the Ros-diffs mailing list