2022-09-05 14:13:51 +00:00
|
|
|
#pragma once
|
|
|
|
#include "memory/Paging.h"
|
|
|
|
|
|
|
|
namespace Paging
|
|
|
|
{
|
|
|
|
class VirtualMemoryManager
|
|
|
|
{
|
2022-09-06 11:49:17 +00:00
|
|
|
public:
|
|
|
|
void init(); // fetch page table from cr3
|
|
|
|
void init(PageTable* PML4);
|
2022-09-05 14:13:51 +00:00
|
|
|
|
2022-09-06 11:49:17 +00:00
|
|
|
void map(uint64_t virtualAddress, uint64_t physicalAddress);
|
|
|
|
void unmap(uint64_t virtualAddress);
|
2022-09-06 16:08:15 +00:00
|
|
|
uint64_t getPhysical(uint64_t virtualAddress);
|
2022-09-05 14:13:51 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
PageTable* PML4;
|
|
|
|
};
|
2022-09-06 11:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extern Paging::VirtualMemoryManager kernelVMM;
|