Author: sir_richard Date: Tue Nov 2 14:46:46 2010 New Revision: 49438
URL: http://svn.reactos.org/svn/reactos?rev=49438&view=rev Log: [NTOS]: You can't just set MDL_LOCKED_PAGES without actually... locking the page. Add a MmReferencePage when doing so, so when that a paging read/write IRP gets completed (and MmUnlockPages is called), the page gets handled correctly. Can now boot with 64MB RAM without ASSERTs. [NTOS]: Fix one of the MDL code paths that isn't getting called frequently.
Modified: trunk/reactos/ntoskrnl/mm/freelist.c trunk/reactos/ntoskrnl/mm/pagefile.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Tue Nov 2 14:46:46 2010 @@ -246,12 +246,14 @@ // ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
- // - // Allocate it and mark it - // + /* Now setup the page and mark it */ + Pfn1->u3.e2.ReferenceCount = 1; + Pfn1->u2.ShareCount = 1; + MI_SET_PFN_DELETED(Pfn1); + Pfn1->u4.PteFrame = 0x1FFEDCB; Pfn1->u3.e1.StartOfAllocation = 1; Pfn1->u3.e1.EndOfAllocation = 1; - Pfn1->u3.e2.ReferenceCount = 1; + Pfn1->u4.VerifierAllocation = 0;
// // Save it into the MDL @@ -370,7 +372,7 @@ }
// - // We're done, mark the pages as locked (should we lock them, though???) + // We're done, mark the pages as locked // Mdl->Process = NULL; Mdl->MdlFlags |= MDL_PAGES_LOCKED;
Modified: trunk/reactos/ntoskrnl/mm/pagefile.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pagefile.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/mm/pagefile.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/pagefile.c [iso-8859-1] Tue Nov 2 14:46:46 2010 @@ -252,6 +252,7 @@
MmInitializeMdl(Mdl, NULL, PAGE_SIZE); MmBuildMdlFromPages(Mdl, &Page); + MmReferencePage(Page); Mdl->MdlFlags |= MDL_PAGES_LOCKED;
file_offset.QuadPart = offset * PAGE_SIZE; @@ -313,6 +314,7 @@
MmInitializeMdl(Mdl, NULL, PAGE_SIZE); MmBuildMdlFromPages(Mdl, &Page); + MmReferencePage(Page); Mdl->MdlFlags |= MDL_PAGES_LOCKED;
file_offset.QuadPart = offset * PAGE_SIZE;