Ring 2, 1

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Chris

Ring 2, 1

Post by Chris »

Ok, i know there is ring 0 and ring 3, but is there a 2 or a 1, if so, could you send me any info?
Kernel Panic

Re: Ring 2, 1

Post by Kernel Panic »

You may want to see this discussion at alt.os.development:
http://groups.google.com/groups?frame=r ... .com#link1
Kernel Panic

Re: Ring 2, 1

Post by Kernel Panic »

And yes, there do exist ring 1 and 2, but Intel doesn't seem to provide any mechanisms for using them with the virtual memory (though it could be easily done): that is, the per-page protection recognises only user level (ring 3) and the supervisor level (all other rings, I suppose; but I may be wrong).
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re: Ring 2, 1

Post by df »

frmo reading the technical docs, it sounds like ring1+2 were meant for things like device drivers, but since all other arch's only have a 0/3 style (kernel/user) levels, using 1+2 makes for interoperability issues + porting issues.
-- Stu --
The_Legend

Re: Ring 2, 1

Post by The_Legend »

What about speed? I've heard that switching from Ring 3 to Ring 0 seems to be relatively slow if compared to switching Tasks from Ring 3 to Ring 3. What about Ring 3 to Ring 2 to Ring 1 and Ring 0?
Kernel Panic

Re: Ring 2, 1

Post by Kernel Panic »

AFAIK, swithing from any lower-privileged level to the higher-privileged one involves calling an INT (or generating an exception, which is actually the same). That is, switching from ring 3 to ring 2 is the same that switching from ring 1 to ring 0.

Switching tasks from ring 3 to ring 3 always involves ring 0, since that's where the scheduler executes. In any multitasking system (provided that it doesn't use some perverted kind of cooperative-multitasking) you can never switch from one user process to another if you ARE a user process.
Post Reply