flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > PM Switch from ring0 to ring3? |
Author |
|
Japheth 06 Nov 2007, 21:55
A switch from ring 0 to ring 3 is done by a RETF or a IRET!
And IOPL is absolutely irrelevant for this mode switch. |
|||
06 Nov 2007, 21:55 |
|
dosin 07 Nov 2007, 00:29
?A switch from ring 0 to ring 3 is done by a RETF or a IRET!
also: to go into ring 3 do I use the IRET again to go back to ring 0.. also what about ring 1 and 2? and would an int ?? cause it to switch since it ends with IRET? should I place the iret or retf in a function: set_ring3: iret ? so far its locking up the sys when I try it |
|||
07 Nov 2007, 00:29 |
|
Japheth 07 Nov 2007, 08:41
> to go into ring 3 do I use the IRET again to go back to ring 0..
this question tells me that you urgently should read the intel documentation first. A switch to a "inner" ring is done through a gate (call, interrupt, trap gates), returning to an "outer" ring is done via RETF/IRET. > set_ring3: > iret Yes, BUT: if a RETF (IRET) causes a ring switch, the cpu expects not just EIP/CS(/EFL) onto the stack, but additionally ESP/SS. If the VM bit is set in the EFL register copy onto the stack and the cpu is in ring 0, the cpu will also expect v86-mode values for ES,DS,FS,GS onto the stack. |
|||
07 Nov 2007, 08:41 |
|
dosin 08 Nov 2007, 07:27
Well I have been going over the manual and some other documentation..
hence my confusion on this... This is from chapter four protection... am I reading in the wrong section on this? Quote: ---INTEL SYS MANUAL--- This was in a 386 programming book and does not discuss the iret or retf Quote: syscall and sysenter and from looking at other OS and articles... Thanks for your help and clarifying it... you given me a good place to start working on it! |
|||
08 Nov 2007, 07:27 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.