request pages

This commit is contained in:
2026-01-28 18:26:24 +11:00
parent 5b508f4a48
commit 012489a658
9 changed files with 19 additions and 1 deletions

View File

@@ -115,6 +115,16 @@ void PageFrameAllocator::ReservePages(void* address, uint64_t pageCount) {
}
}
void* PageFrameAllocator::RequestPage() {
for (uint64_t index = 0; index < PageBitmap.Size * 8; index++) {
if (PageBitmap[index] == true) continue;
LockPage((void*)(index * 4096));
return (void*)(index * 4096);
}
return NULL; // page frame swap to file
}
uint64_t PageFrameAllocator::GetFreeRAM() {
return freeMemory;