GPF or QEMU crash when entering Ring 3

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.
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: GPF or QEMU crash when entering Ring 3

Post by osdever »

Debugging is working, but it's just freezes when debugger is connected. Neither nexti or next, nor stepi or step are not working.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: GPF or QEMU crash when entering Ring 3

Post by osdever »

Finally debugging is worked. Using trial&error I find that the code is crashing on iret. But what is causing that?
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
Combuster
Member
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:

Re: GPF or QEMU crash when entering Ring 3

Post by Combuster »

I've seen a pageful of likely reasons (and less likely reasons that are nonetheless bugs) already. Which ones don't apply?

You can also run the entire set of steps from the Intel manuals by hand and use the actual register/memory values to see what happens exactly.
"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 ]
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: GPF or QEMU crash when entering Ring 3

Post by iansjack »

Check the items on the stack just before the iret. Are they what you expect them to be? Are they sane? What will iret do with them?
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: GPF or QEMU crash when entering Ring 3

Post by osdever »

iansjack wrote:Check the items on the stack just before the iret. Are they what you expect them to be? Are they sane? What will iret do with them?
How I can do it? GDB is freezing QEMU.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Post Reply