
How do i exit from supervisor mode?
Quote:
> I have a problem with entering protection level 3 (from level 0) on the x386.
. . .
> I'm trying to 'fake' a iretd stack in order to enter a CPL 3 CS.
> Stack: WORD new ss (my default flat data segment - i also tried the CPL 3
> data segment)
It should be a DWORD, not a WORD (the high word is ignored, but
takes up space in the stack frame).
It must be a valid DPL 3 data segment. I assume your default
flat data segment is not.
Quote:
> DWORD new esp
Must be within the limit for the segment.
Quote:
> DWORD flags (which i set to 0)
I think zero is OK, I am not sure.
Quote:
> WORD new CS (with a CPL of 3) DWORD new IP
CS also must be a DWORD.
You also should set the other segment registers to
select DPL 3 descriptors.
Quote:
> Then i do a 'iretd' and... crash! If i use a CPL 0 CS (i.e. a non-priviledge
> transition return), it works! Oh btw, iv'e set up an TSS, but it shouldn't be
> needed at this time anyway...
The TSS isn't needed to iretd from 0 to 3, but the ss0 and
esp0 fields of the TSS are required to fault or interrupt
back to 3 from 0.
--
http://www.*-*-*.com/
http://www.*-*-*.com/