www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/20/10:14:04

Date: Fri, 20 Sep 1996 15:42:58 +0200 (MET DST)
From: Mark Habersack <grendel AT ananke DOT amu DOT edu DOT pl>
Reply-To: grendel AT ananke DOT amu DOT edu DOT pl
To: snarfy AT goodnet DOT com
cc: djgpp AT delorie DOT com
Subject: Re: What are protected mode rings?
In-Reply-To: <51s5pu$qug@news.goodnet.com>
Message-ID: <Pine.NEB.3.95.960920153058.6416G-100000@ananke.amu.edu.pl>
MIME-Version: 1.0

On 19 Sep 1996 snarfy AT goodnet DOT com wrote:

>I was just wondering what it means for something to run at 'ring-0' or
>'ring-3'.  What are these rings?  Are there any good books that explain
>what these rings are?  Thanks.
Rings is a term that is related to protection scheme used on i386+ machines.
Basically rings are 'areas' in which CPU executes fragments of code, stores
 data etc. Every program has a number associated with it, called CPL (Current
Privilege Level) which is directly related to the notion of 'rings'. If the
program with, say, CPL == 3 wants to access data stored on ring 0, the CPU
prevents it from doing so by triggering an exception. From this you may guess
that the most 'privileged' ring (i.e. the one in which everything is allowed
;-))) - usually reserved for system's kernel) is 0, while the most
'restricted' is 3 (that is the topmost or outermost ring of i386 protection
scheme). The basic idea is that the higher CPL of currently executed code is,
the less 'privileges' it has. No program at the higher ring can access data
and code (well, it may call code from the lower rings by means of
call/interrupt/task gates in program's LDT or system GDT, but this is too
complicated to explain here) of a program living in a 'lower' (i.e. more
privileged) ring.
 There's a lot more to that than I can write here, I'd suggest you download a
386 programmer's manual from Intel site (http://www.intel.com) or from x86 org
site (ftp://ftp.x86.org I guess). The manual describes every aspect of i386
architecture.

mark

**********************************************************************
So if you ask me how do I feel inside, I could honestly tell you we've
been taken on a very long ride. And if my owners let me have free time
some day, with all good intention I would probably run away!
Clutching the short straw...
******************* http://ananke.amu.edu.pl/~grendel ****************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019