page fault on real machine

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
lama
Member
Member
Posts: 83
Joined: Thu Apr 16, 2009 8:41 am

page fault on real machine

Post by lama »

Hi,
i have one very strange problem.i did not notice it until today,when i rebooted my machine and tried my code 'in real' (i'm using bochs, here everything works fine).shortly after the kernel is loaded, cpu is interrupted by page fault.using qemu ( here is the situation the same) i discovered, that page fault is raised when call instruction is executed (not just random call instruction in code, just this one.). esp is high enough, ss is set properly, and the hole thing is below code and data, so there cant be any lack of stack space, right?plus - after page fault is in cr2 address around 0x7800000 (this is exactly the same value as value in eax, strange..)how could this possibly happen if there is simply no code which would access this high memory..?when i use 0xff call (address given in register) the value in esi is changed and points somewhere insanily high in memory - then page fault occurs.
once again - in bochs runs everything well, it is crashing 'only' on real machine and qemu..
can anyone please explain me what i'm doing wrong?btw sorry for my terrible english and thanks for any answer.
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Re: page fault on real machine

Post by frank »

Are you using a function pointer anywhere? Bochs clears all memory to 0 before running, Qemu and a real machine cannot make that promise. Maybe you should look for uninitialized variables or anywhere that your code may depend on memory being 0.
Post Reply