Page 1 of 1

how to shift from 0 Privelege Level to PL 3

Posted: Mon May 03, 2004 11:00 pm
by Aks
Hi,

I am having trouble shifting from Privelege Level 0 to PL 3. How can I do the same using TSS provided in 386. I also want to use the LDT for each task. Could anyone please help me with the above. An example code would be very helpful. my email is "[email protected]".
thnx
Akshat

RE:how to shift from 0 Privelege Level to PL 3

Posted: Mon May 03, 2004 11:00 pm
by TheUbu
Aks,

If you set up your TSS to use RING 3 CS,DS and so on make sure when you set the descript ie 0x18 into your gdt do + DPL3 so tss.cs = 0x18 +3; for everything ring three then do your usuall long jump.


-Christopher

RE:how to shift from 0 Privelege Level to PL 3

Posted: Tue May 04, 2004 11:00 pm
by aks
hi

i am using an ldt for each task...in the tss i am setting the cs value to 12(Since code segment descriptor is no. 8...terefore 8+4)..similarly i m setting ds and ss value to 20 each(16+4)...i am setting ss0,ss1,ss2 to 0...also i am setting the flags to 0x200(for interrupts)....
now when i set the task dpl to 0 everything works fine...but when i set it to 3 i get an invalid tss exception.....
i tried making the cs to 15(8+4+3) ,ds and ss to 23 but then my VMware says a stack fault has occured....
pls help...i have to switch between kernel and user mode....i have to submit my os in 30 days......some examples will certainly help....

i am having another error.....i gat a GP fault every time i enter an infinite loop...plz help...
i havent initialised my timer......
thnx
aks

RE:how to shift from 0 Privelege Level to PL 3

Posted: Tue May 04, 2004 11:00 pm
by ASHLEY4
Go here:   http://my.execpc.com/~geezer/os/
And click on "Protected-mode demo code" link this zip file as some good code that will help.

ASHLEY4.