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 have been searching this forum for two days hoping to find the awnser to my question. I'm working on my kernel and I got GDT IDT ISR and IRQ all setup and working so I'm moving on to my memory manager. My first try at setting up paging worked becouse I worked along with osdever's tutorial. But when I try to change the point at wich the paging starts my kernel crashes, it just reboots (so there is no exception trown?). Here is my paging setup code.
No, I'm sure there is an exception thrown, but I guess that either your idt or your exception handler is not available.
If you activate paging, you have to make sure that not only your code is accessible, but also your gdt/idt and of course all isrs, and of course at the same addresses as before you started paging.
If I read your code right, you map the physical space between 0x00100000 and 0x004FFFFF to the virtual space 0x00000000 - 0x003FFFFF ... that means that none of your virtual addresses match the physical addresses. So the system can not find the idt and gdt any more, it can't even find your code because it searches at the same addresses as before you start paging.
[edit]After your paging works you should try to create an address space manager. You have 4 GB of address space ( independant of how much physical memory you have ) and I think you need to decide dynamically how to use it[/edit]
I got allocating and deallocating working but I can't write to the pointer that k_allocpage returns. Anyone has an idea why? When I write the address of the pointer to the screen it seems right.
Could you tell me the number of the virtual page k_allocpage uses and which address it returns (in hexadezimal notation) ... the last three digits of the address should be zero
Tjaalie wrote:I got allocating and deallocating working but I can't write to the pointer that k_allocpage returns. Anyone has an idea why? When I write the address of the pointer to the screen it seems right.
Maybe I'm reading your code wrong, but it looks to me like you're trying to write into the page table, not an allocated page...?
I'm not sure about this construction ... are you sure that's correct ? A page directory entry is a 32 bit number, not a struct, not even a packed struct ... Maybe I got it wrong