the 6-byte the bit number 3 from right, which is used to select data or stack segment in data segments, i read that when it is disabled in code segments the cpu will not check the RPL or DPL i don't remember. but all i know is that enabling it cause troubles
can u figure out what is this bit in the code segments ?
Ring 0 Vs Ring 3
Re:Ring 0 Vs Ring 3
Hi,
This allows you to have some code (in a conforming code segment) that can be used at any privilege level. For example, kernel code could use it and still be operating at CPL=0 and user-level code could also use it (but still operate at CPL=3). In this way the code conforms to the privilege level of who-ever called it.
It's possibly useful for shared code - for example, imagine you've got some code to convert strings into numbers and numbers into strings that is in it's own code segment. The kernel could use it to convert strings stored in kernel space, and user-level code could use it to convert strings stored in user-space (but if user-level code tried to convert strings that are stored in kernel space it'd cause a general protection fault).
Cheers,
Brendan
This is the 'C' bit which makes the code segment "conforming". For a conforming code segment, the DPL is still checked when the segment is loaded into CS but the RPL isn't changed (i.e. the current privilege level isn't changed).Unlink wrote: the 6-byte the bit number 3 from right, which is used to select data or stack segment in data segments, i read that when it is disabled in code segments the cpu will not check the RPL or DPL i don't remember. but all i know is that enabling it cause troubles
can u figure out what is this bit in the code segments ?
This allows you to have some code (in a conforming code segment) that can be used at any privilege level. For example, kernel code could use it and still be operating at CPL=0 and user-level code could also use it (but still operate at CPL=3). In this way the code conforms to the privilege level of who-ever called it.
It's possibly useful for shared code - for example, imagine you've got some code to convert strings into numbers and numbers into strings that is in it's own code segment. The kernel could use it to convert strings stored in kernel space, and user-level code could use it to convert strings stored in user-space (but if user-level code tried to convert strings that are stored in kernel space it'd cause a general protection fault).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
Re:Ring 0 Vs Ring 3
Save yourself from troubles and don't set it.
But if you had a LOT of code which can be shared between kernel and user's tasks then maybe you could think about it.
To do that you'll have to make extra code segment descriptors.
But if you had a LOT of code which can be shared between kernel and user's tasks then maybe you could think about it.
To do that you'll have to make extra code segment descriptors.