Compute PTE count per page from entry size
Some checks failed
Builds / ExectOS (amd64, debug) (push) Successful in 28s
Builds / ExectOS (amd64, release) (push) Successful in 26s
Builds / ExectOS (i686, release) (push) Failing after 20s
Builds / ExectOS (i686, debug) (push) Failing after 21s

This commit is contained in:
2025-12-15 13:56:39 +01:00
parent 36c273ea13
commit 7f0ca6a948
4 changed files with 21 additions and 9 deletions

View File

@@ -38,10 +38,12 @@ MM::Manager::InitializeMemoryLayout(VOID)
{
ULONG_PTR PagedPoolSize, PteCount;
PFN_NUMBER PfnDatabaseSize;
ULONG PtesPerPage;
/* Calculate size of paged pool (at least 32MiB) */
PteCount = ((SIZE_TO_PAGES(33554432) + (MM_PTE_PER_PAGE - 1)) / MM_PTE_PER_PAGE);
PagedPoolSize = PteCount * MM_PTE_PER_PAGE * MM_PAGE_SIZE;
/* Get the number of PTEs per page and calculate size of paged pool (at least 32MiB) */
PtesPerPage = MM::Pte::GetPtesPerPage();
PteCount = ((SIZE_TO_PAGES(33554432) + (PtesPerPage - 1)) / PtesPerPage);
PagedPoolSize = PteCount * PtesPerPage * MM_PAGE_SIZE;
/* Retrieve the PFN database size */
PfnDatabaseSize = MM::Pfn::GetPfnDatabaseSize();