Hi all,
I've managed to write a hello-world example with a physical memory manager using D, and I'm now trying to enable paging. I've set up the page directories, and to my knowledge, they're all correct (they're aligned and have the correct mappings); I've tested the mapping before enabling to ensure that the kernel (which contains all the page tables) and the lowest 1 MB (which has the video memory) is mapped onto itself, and it seems to be the case.
As soon as I try to write to the screen after I enable paging, I get "interrupt(): gate descriptor is not valid sys seg" in Bochs. However, if I comment out the 3-instruction assembly code that enables paging, then the write succeeds. The OSDev Wiki states that the cause of this error is that "You have not loaded an IDT, or the IDT is corrupt", but it doesn't make sense to me because this only happens when paging is enabled... could anyone explain what is happening?
Thank you!
Paging Enabled -> "gate descriptor is not valid sys seg"
Re: Paging Enabled -> "gate descriptor is not valid sys seg"
Never mind, I found the problem. It turned out to be because of a multiplication instruction -- apparently it issued an interrupt that wasn't handled. I'll try to figure out how to fix it, but if anyone has any guides, I'd really appreciate it!