request pages
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user