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.
When I tried to enter ring 3 I got GPF first I thought that I't because that I don't have a working tss. when I tried to set tss I got GPF again. this is the code which I use to enter user mode:
GPF err_code when tried to switch to user mode is 0x20 which is my PL3 data segment selector
GPF err_code when tried to switch to user mode is 0x28 which is tss selector
We can't do much with not a lot of info. Show us your GDT, your TSS and check if it's valid.
Your TSS loading code looks ok, and the switch_to_usermode looks alright too.
Also, do you make an entry in the GDT for the TSS?
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
thanks for your help the problem is fixed.when I installed bochs and used its internal debugger it showed that my gdt has only 3 entries then I realized that the problem is with gdt limit.
the problem was this line:
Oh yes, I didn't see that error in your code. Anyways, have fun!
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx