[Prev][Next][Index][Thread]

Re: Priviledge switch with 'iret'




> >I have four segments: KCS, KDS, UCS and UDS. K* have DPL 0, U* has DPL 3.
> >When I tries to make an far iret from K* segments to U* segments it
> >doesn't make a priviledge switch -> it doesnt pop the UESP and SS from the
> >stack. Why's that?
> 
> What segment values are you using ?  Don't forget that you need to set the
> RPL in the segments... so if your user code segment is at 0x18 in the GDT,
> you should be using (0x18|3) as your segment value.  Same goes for the user
> data segment.  Could that be the problem ?

No that is not the problem. 

Here is my segment values:	KCD	0x8
				KDS	0x10
				UCS	0x18 (with RPL 0x1B)
				UDS	0x20 (with RPL 0x23)

Before the iret: %cs = 0x8, %ds = 0x10, %ss = 0x10
After the iret : %cs = 0x1b, %ds = 0x23, %ss = 0x10

-- Johan




References: