From ecc19f4df03641540eba01aa01f6320c973aba9c Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 19 Apr 2023 00:50:09 +0300 Subject: [PATCH] Reserve all pages and then unreserve available pages --- Core/Memory/PhysicalMemoryManager.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Core/Memory/PhysicalMemoryManager.cpp b/Core/Memory/PhysicalMemoryManager.cpp index f037d73..3223647 100644 --- a/Core/Memory/PhysicalMemoryManager.cpp +++ b/Core/Memory/PhysicalMemoryManager.cpp @@ -419,14 +419,9 @@ namespace Memory *(uint8_t *)(PageBitmap.Buffer + i) = 0; debug("Reserving pages..."); - for (uint64_t i = 0; i < Info->Memory.Entries; i++) - { - if (Info->Memory.Entry[i].Type != Usable) - this->ReservePages(Info->Memory.Entry[i].BaseAddress, TO_PAGES(Info->Memory.Entry[i].Length)); - } + this->ReservePages(0, TO_PAGES(Info->Memory.Size)); + debug("Unreserving usable pages..."); - /* Making sure that the lower memory area is properly reserved. */ - this->ReservePages(0, 0x200); for (uint64_t i = 0; i < Info->Memory.Entries; i++) { if (Info->Memory.Entry[i].Type == Usable)