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.
This is my paging code so far (fasm code). When I enable paging by writing to cr0 the cpu resets. I am trying to identity map the first 4 megabytes. Obviously I did something very wrong, but what?
One thing i can think of is shouldn't the page directory be page aligned? You don't need to have space in your kernel code for it, just choose a area of unused memory.
Edit: also the same applies to each page table - they must be page aligned.
Thanks for the help. I don't know what I was thinking. You know, when you look at the code for too long you see what you want to see and not what you typed...
liquid.silver wrote:You don't need to have space in your kernel code for it, just choose a area of unused memory.
I just wanted to make things simple first (by putting them in the bss I made sure everything in them was zero before I started messing with them). I am now allocating the page directory and table dynamically from the page frame map.