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.
Hi all,
I am developing a OS with two privilege levels ring0 and ring3.After doing kernel init I am trying to switch to ring 3 code segment.Its giving GP fault for me.
For one, have you checked which instruction is causing the GPF? (tried using Bochs' debugger?)
Secondly, you are setting SS while it has already been set to the correct value.
Wild guess: have you set RPL to 3 as well (i.e. using selector + 3 for cs, ss and ds)
"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 ]
It is considered "good style" to give a hint as to what the problem was and how you solved it, so that others that have a problem with "Privilege level switching in x86" will find a solution in this thread, instead of a loose end.
Every good solution is obvious once you've found it.