Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I'm trying to write a paging system, but there's something wrong with my function that maps physical to virtual addresses. I'm trying to map 0x27000 to 0x45000000, but it's mapping it to 0xFFFFFF00.
Not only have you already cleared the new page table (the previous memset), the address you're passing is wrong - you use the PDE as an address without clearing flags from it first. Can you post the definitions of the page_table structure and the structure you're using for the page directory?
Just had a quick look at your code. It looks like pt is a virtual address, but you are storing it in the page directory. The page directory should contain physical addresses.
If a trainstation is where trains stop, what is a workstation ?
That's a waste of clock cycles - invlpg is atomic as-is, there's absolutely no need to enclose it in an interrupt mutex.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]