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.
Hi there I've a serious problem with my Paging:
Source Code? https://docs.google.com/file/d/0B-x3QNi ... UzLUk/edit
What I want to do?
I've allready declared Functions for allocating memory in the virtual address space copyout/in and mapping for the Usermode,but I'm not trying to get those work yet. I just want to setup the Page and Page directory tables for the kernel enable Paging and stay in an endless while loop.
What's going wrong?
As you can see in the qemu.log below I'm having a triplefault as I haven't mapped anything. 101 can be found in cr2 at he first fault.
What I found out?
I placed lots of text outputs in "vmm_map_page"(in my Paging source file src/kernel/mm/vmm.c) and figured out that the page directory and the page table were setup as it should be(I could also use GDB and examine the Memory, but "remote target :1234" doesn't work). It's still possible,that I have forgotten something in the tables,but well it could be also something with my inline ASM.
Thanks a lot for the help (verdammt Kevin ist auch im englischen Forum^^)
Are you saying the faulting instruction is the move to %cr0? I'm still not clear about this. You have just given us a general function in which the fault occurs. How do you know the problem is not in the following print function? Do your page tables map virtual addresses to the same physical addresses or what?
It really would help if you could provide a disassembly listing of the code in the region of the fault.
Last edited by iansjack on Sun Feb 24, 2013 7:35 am, edited 1 time in total.
I found out that GCC is storing the fields of my Pagetable/Pagedir entries in the opposite order.
I also use 3 bits for free space and 21 bits for pointers. Now my last PageTable is 0xb00FFFF and my last PDIR entry is 0xb000064, but I'm still getting a triplefault
erhardt wrote:Now my last PageTable is 0xb00FFFF and my last PDIR entry is 0xb000064
And both seem to point to nonexistent RAM...
"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 ]
Hi, I changed my source Code again now It is here. https://docs.google.com/file/d/0B-x3QNi ... JQcXM/edit
In changed my PageTbl and PageDir so that The Pointer is coming first.
Now 0x7fff80bf is my last PGTbl entry and 0x0003200b my last PDir entry.
But it's still not working.
I think that it's your computer's way of telling you that it's time to learn how to debug with qemu. Sort that out first and then you will be in a better position to examine your page tables and find what you have done wrong. It would also be a good idea to implement some simple exception handlers (if you haven't already done so) so that every exception doesn't end up as an uninformative triple fault.
If you are using Linux and can't get qemu debugging to work (it's very simple, so I can't think what your problem is there) you might like to look at SimNow for assembler-level debugging.