Privilege level 3
Posted: Thu Feb 26, 2004 8:29 am
Hello.
I'm writing an OS (a small one), but I have a problem.
Many say it's easy to do that, but I think not.
My problem is I can't run a task in ring 3.
For example, when I set the SS to 43 (a privilege 3 descriptor) the OS gives a #GP fault :'(
The TSS is loaded before this, and with the good values, so I think that ain't the problem.
What could be the problem ?
My descriptors(maybe that will help):
GDT_ME dd 0,0
dd 0000ffffh ;ring 0 code segment 8
dd 00cf9a00h
dd 0000ffffh ;ring 0 data segment 16
dd 00cf9200h
dw 103
dw tss_begin
dw 1000100100000000b
dw 0
;define a ring 3 code segment
dd 0x0000ffff
dd 0x00cffa00
;data
dd 0x0000ffff
dd 0x00cff200
I'm writing an OS (a small one), but I have a problem.
Many say it's easy to do that, but I think not.
My problem is I can't run a task in ring 3.
For example, when I set the SS to 43 (a privilege 3 descriptor) the OS gives a #GP fault :'(
The TSS is loaded before this, and with the good values, so I think that ain't the problem.
What could be the problem ?
My descriptors(maybe that will help):
GDT_ME dd 0,0
dd 0000ffffh ;ring 0 code segment 8
dd 00cf9a00h
dd 0000ffffh ;ring 0 data segment 16
dd 00cf9200h
dw 103
dw tss_begin
dw 1000100100000000b
dw 0
;define a ring 3 code segment
dd 0x0000ffff
dd 0x00cffa00
;data
dd 0x0000ffff
dd 0x00cff200