In my bootloader, I identity map the first 4MB of memory. Once in the kernel, I want to unmap it, because 0x00000000 - 0xBFFFFFFF will be reserved for userland. I remap the video memory, kernel stack and my memory management bitmap (which are all located in memory < 4MB) to kernel land virtual addresses. Then I try to clear the first entry in the page directory like so:
Code: Select all
pd_entry* pde = vmmngr_pdirectory_lookup_entry(vmmngr_get_directory(), 0x00000000);
*pde = 0;
If I do this -
Code: Select all
pd_entry* pde = vmmngr_pdirectory_lookup_entry(vmmngr_get_directory(), 0x00000000);
//*pde = 0;
DWORD* ptr = (DWORD*)0xA0000000; //unmapped virtual address
*ptr = 125235;
So my suspicion now is that the IVT, which is located at 0x00000000 physical address, is trying to be accessed.
Is the IVT used in protected mode? I thought it was only for real mode, then the IDT takes over in protected mode.
Extra info:
The page directory is located at 0x80000 (within the first 4MB) - So I'm effectively unmapping memory at the same time I use it... this shouldn't matter though, as the CPU would have to find the physical location before actually editing the memory.