I discovered a weired issue in my VMM-Mapping-Methods.
The following code works:
Code: Select all
void KernelTable::Map2M(void *VirtAddress, const void *PhysAddress, uint64_t Bitmap)
{
uint16_t PML4I = (((uint64_t)VirtAddress) >> 39) & 0x1FF;
uint16_t PDPTI = (((uint64_t)VirtAddress) >> 30) & 0x1FF;
uint16_t PDI = (((uint64_t)VirtAddress) >> 21) & 0x1FF;
uint64_t *PML4E = GetAddress(511, 511, 511, PML4I);
Check(PML4E, Bitmap);
uint64_t *PDPTE = GetAddress(511, 511, PML4I, PDPTI);
Check(PDPTE, Bitmap);
uint64_t *PDE = GetAddress(511, PML4I, PDPTI, PDI);
CheckPage(PDE, PhysAddress, (Bitmap | PG_BIG));
}
Thanks for your help!
EDIT: Well i've somehow fixed it... I changed my Check-Methode and now it works without the const in the parameter list... The question is why?
This is the original Check-Methode:
Code: Select all
void KernelTable::Check(uint64_t *Entry, uint64_t Bitmap)
{
if ((*Entry == 0) || (((*Entry) & 0x1) == 0))
{
*Entry = (uint64_t)PMM::Alloc4K.Alloc() | Bitmap;
}
}
Code: Select all
void KernelTable::Check(uint64_t *Entry, uint64_t Bitmap)
{
if ((*Entry == 0) || (((*Entry) & 0x1) == 0))
{
*Entry = (uint64_t)PMM::Alloc4K.Alloc() | Bitmap;
void *NextEntry = (uint64_t)Entry << 9;
memset(NextEntry, 0, 4096);
}
}