paging problem in bochs but no vmware
Posted: Tue Dec 13, 2005 3:28 pm
here's my situation. I have setup user space applications, and they work very nicely in vmware, but fail miserably in bochs.
I have narrowed down the issue to my mapping of pages into the user space process.
Here a synopsis of my algorithm.
i have 3 temp mapping addresses. 0xf0001000, 0xf0002000, and 0xf0003000. these are used to so i can alter the contents of the pages which will be in the target process (i have a "process->mapPage(virt, phys, flags);")
when mapping pages there are two processes i will refer to. "current" means the one that is running now and is doing the mapping, "target" means the process which i intend to map the page to.
so first i make sure that in the current process there is a page table setup in it's page dir that will let me map in pages at the previously mentioned addresses.
now every time i map or unmap a page anyway, i do an invlpg for that page to be safe (though i think this is only needed for unmapping right?)
this works perfectly in vmware (I haven't test on real deal recently but will shortly) but in bochs it fails on step 2 when reading the page dir of the parget process through 0xf0001000! and I have no clue why. I am absolutely lost as to why this doesn't work.
BTW, i've recently noticed that it under some circumstances seems to work in bochs, for example i am able to map and execute pages for my v8086 monitor in bochs just fine, just not my user space apps
so...see anything wrong? or should I be looking for something else?
proxy
I have narrowed down the issue to my mapping of pages into the user space process.
Here a synopsis of my algorithm.
i have 3 temp mapping addresses. 0xf0001000, 0xf0002000, and 0xf0003000. these are used to so i can alter the contents of the pages which will be in the target process (i have a "process->mapPage(virt, phys, flags);")
when mapping pages there are two processes i will refer to. "current" means the one that is running now and is doing the mapping, "target" means the process which i intend to map the page to.
so first i make sure that in the current process there is a page table setup in it's page dir that will let me map in pages at the previously mentioned addresses.
Code: Select all
1) then i map the target's PD at 0xf0001000 of the current process.
2) I then check the target's PD (via 0xf0001000) to see if it has a page table at the desired address, if it doesn't i allocate one and set it.
3) I then map the target's page table for the desired virtual address at 0xf0002000 of the current process.
4) I then check if there is already a page allocated at the desired virtual address if so, clean up, error out
5) finally I map the page into the page table (via 0xf0002000)
6) If the "zero page" flag is set, i map the target page at 0xf0003000 and zero it
7) cleanup, unmap, etc
this works perfectly in vmware (I haven't test on real deal recently but will shortly) but in bochs it fails on step 2 when reading the page dir of the parget process through 0xf0001000! and I have no clue why. I am absolutely lost as to why this doesn't work.
BTW, i've recently noticed that it under some circumstances seems to work in bochs, for example i am able to map and execute pages for my v8086 monitor in bochs just fine, just not my user space apps
so...see anything wrong? or should I be looking for something else?
proxy