paging
paging
i implemented paging using JamesM's tutorials, and it seems to work fine except for the page_fault handler... but we wont go into that, ill get it working, or create another thread once iv had a decent shot at it anyway.
but my problem is that it runs fine on bochs and qemu, but when i run it on ms virtual pc, it dies giving a "fatal processor error" in a messagebox.
has anybody else experienced this and knows a solution?
lukem95!
but my problem is that it runs fine on bochs and qemu, but when i run it on ms virtual pc, it dies giving a "fatal processor error" in a messagebox.
has anybody else experienced this and knows a solution?
lukem95!
Re: paging
^^ Theres your problem... MS virtual PC is made to run windows, dos, and os/2 iirclukem_95 wrote:i run it on ms virtual pc
--Michael
- liquid.silver
- Member

- Posts: 46
- Joined: Sat Jun 30, 2007 12:07 pm
- Location: South Africa
- Contact:
I haven't read the tutorial, but last time I booted my OS on a real PC it worked great, and it uses paging. Any chance we could take a look at the functions in question, it's hard to really debug without looking at anything, just saying: "Hey, my program crashes, does anybody know why" won't receive to many useful answer (I know you were a little more specific saying you were implementing paging from JamesM's). One thing that pops to mind, is make sure you invalidage the pages as you are setting them up.
oh god sorry, my original post actually sucked =\ (it was 1am ish when i made it)...
ok well i wasn't really asking for help on the paging thing, as it seems to be working fine. I'll try it on actual hardware and edit this post with the results. Thankyou all for your replies though
EDIT: it works on a real pc... so i guess MS have some queer code in there, unless its just something funny going on =\
ok well i wasn't really asking for help on the paging thing, as it seems to be working fine. I'll try it on actual hardware and edit this post with the results. Thankyou all for your replies though
EDIT: it works on a real pc... so i guess MS have some queer code in there, unless its just something funny going on =\
Sometimes when that happens, it could possibly be something not being initialized properly, or possibly just one of the m$ bugs, hard to say really, but if it works on real hardware, then that should sufficelukem_95 wrote:oh god sorry, my original post actually sucked =\ (it was 1am ish when i made it)...
ok well i wasn't really asking for help on the paging thing, as it seems to be working fine. I'll try it on actual hardware and edit this post with the results. Thankyou all for your replies though
EDIT: it works on a real pc... so i guess MS have some queer code in there, unless its just something funny going on =\
- Combuster
- Member

- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
The only bugs in VPC I'm aware of deal with VME, and also appear in QEmu.
VPC does run non-windows OSes, including mine. Normally if something doesn't work in VPC it doesn't work on some or all real PCs as well. The chance that you picked a bug is small, most likely its an oversight in your code.
In other words: Time to implement proper error handlers
VPC does run non-windows OSes, including mine. Normally if something doesn't work in VPC it doesn't work on some or all real PCs as well. The chance that you picked a bug is small, most likely its an oversight in your code.
In other words: Time to implement proper error handlers
Yeah, just be careful, I had a problem where my code was working on a real PC and crashing in Bochs... come to find out, it was some un-initialized memory, on my PC I guess it was being set to all zero's, so it was just doing NOP's a bunch of times, in bochs it set the memory to something for debugging and would crash with invalid instructions, so it is still very possible that it's some code that may be working on your PC but might crash another, you need to track down where it's crashing at to find out exactly what/where the problem is coming from.Combuster wrote:The only bugs in VPC I'm aware of deal with VME, and also appear in QEmu.
VPC does run non-windows OSes, including mine. Normally if something doesn't work in VPC it doesn't work on some or all real PCs as well. The chance that you picked a bug is small, most likely its an oversight in your code.
In other words: Time to implement proper error handlers
Are you sure you got that the right way around? Bochs is notorious for having all it's memory set to 0 lulling people into thinking their code works properly.
The cake is a lie | rackbits.com
-
djenkins75
- Posts: 11
- Joined: Sun Dec 16, 2007 11:32 am
- Location: Wisconsin, USA
MS-Virtual PC vs others
I too discovered that my code would crash on VPC and run fine on VMWare.
It seems that if your virtual machine tries to access physical ram that is not there (but the virtual address is mapped), that on VMWare reads will return "0x00". On virtual PC they returned "0xff" (or so I remember).
In other words:
1) Configure a VM for 4M of ram.
2a) With paging disabled, but in p-mode in your VM, read from 0x80000000. The read should work (on real hardware you're reading gibberish).
2b) Enable paging. Map physical 0x80000000 to someplace in your virtual memory map. Now try to read the virtual address. You should get the same result as above.
My theory is that VMWare / Virtual PC map all non-existant (from point of view of your VM) physical memory to a real page that is initialized with all 0x00 or 0xff.
I fixed my bug before testing on Bochs. My real PC (a dell dimension 8400, some intel chipset) returns '0xff' for reads of non-existant memory (and hence my code crashed on bare metal).
I hope that this helps.
It seems that if your virtual machine tries to access physical ram that is not there (but the virtual address is mapped), that on VMWare reads will return "0x00". On virtual PC they returned "0xff" (or so I remember).
In other words:
1) Configure a VM for 4M of ram.
2a) With paging disabled, but in p-mode in your VM, read from 0x80000000. The read should work (on real hardware you're reading gibberish).
2b) Enable paging. Map physical 0x80000000 to someplace in your virtual memory map. Now try to read the virtual address. You should get the same result as above.
My theory is that VMWare / Virtual PC map all non-existant (from point of view of your VM) physical memory to a real page that is initialized with all 0x00 or 0xff.
I fixed my bug before testing on Bochs. My real PC (a dell dimension 8400, some intel chipset) returns '0xff' for reads of non-existant memory (and hence my code crashed on bare metal).
I hope that this helps.


