Bochs's bug in handling Page Table Entries

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.
Post Reply
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Bochs's bug in handling Page Table Entries

Post by XCHG »

I allocate some PTEs and, using my Relocate function, I will change the location of the allocated memory to somewhere else in the memory and thus get a new pointer to the memory block. If I have not written something to the first memory that was allocated and then try to relocate the memory, everything will work fine but if I have already written something to the initial memory block and then try to relocate the memory, Bochs will not show me a Page Fault Exception even though the PTE that maps the memory that I am addressing neither has its Present flag nor its Read/Write bits set. Does anybody have any idea why?

I tried my code on VMWare and I got a Page Fault Exception meaning that VMWare noticed that the PTE that I just set as not present is not really present! MS Virtual PC didn't give me a PF, just like Bochs.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

Did you invalidate the tlb after changing the page table entries? Once you access the memory the first time, it looks up the page tables. After that, the physical address is cached in the tlbs and not updated, even if you change the page table.

Regards,
John.
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Post by XCHG »

I just figured it out lol. But I did it before you told me :? It is strange though how VMWare generates a Page Fault Exception but Bochs doesn't.

Thank you jnc100 for your help.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
Aali
Member
Member
Posts: 58
Joined: Sat Apr 14, 2007 12:13 pm

Post by Aali »

emulating the TLB probably just makes things slower
it is not neccesary for "normal" operation after all
Post Reply