Multiple rings of protection were among the most revolutionary concepts introduced by the
Multics operating system, a highly secure predecessor of today's
Unix family of operating systems. The
GE 645 mainframe computer did have some hardware access control, including the same two modes that the other GE-600 series machines had, and segment-level permissions in its
memory management unit ("Appending Unit"), but that was not sufficient to provide full support for rings in hardware, so Multics supported them by trapping ring transitions in software; its successor, the
Honeywell 6180, implemented them in hardware, with support for eight rings; Protection rings in Multics were separate from CPU modes; code in all rings other than ring 0, and some ring 0 code, ran in slave mode. However, most general-purpose systems use only two rings, even if the hardware they run on provides more
CPU modes than that. For example, Windows 7 and Windows Server 2008 (and their predecessors) use only two rings, with ring 0 corresponding to
kernel mode and ring 3 to
user mode, Many modern CPU architectures (including the popular
Intel x86 architecture) include some form of ring protection, although the
Windows NT operating system, like Unix, does not fully utilize this feature.
OS/2 does, to some extent, use three rings: ring 0 for kernel code and device drivers, ring 2 for privileged code (user programs with I/O access permissions), and ring 3 for unprivileged code (nearly all user programs). Under
DOS, the kernel, drivers and applications typically run on ring 3 (however, this is exclusive to the case where protected-mode drivers or DOS extenders are used; as a real-mode OS, the system runs with effectively no protection), whereas 386 memory managers such as
EMM386 run at ring 0. In addition to this,
DR-DOS' EMM386 3.xx can optionally run some modules (such as
DPMS) on ring 1 instead.
OpenVMS uses four modes called (in order of decreasing privileges) Kernel, Executive, Supervisor and User. only use ring 0 and 3. A renewed interest in this design structure came with the proliferation of the
Xen VMM software,
ongoing discussion on
monolithic vs.
micro-kernels (particularly in
Usenet newsgroups and
Web forums), Microsoft's
Ring-1 design structure as part of their
NGSCB initiative, and
hypervisors based on
x86 virtualization such as
Intel VT-x (formerly Vanderpool). The original Multics system had eight rings, but many modern systems have fewer. The hardware remains aware of the current ring of the executing instruction
thread at all times, with the help of a special machine register. In some systems, areas of
virtual memory are instead assigned ring numbers in hardware. One example is the
Data General Eclipse MV/8000, in which the top three bits of the
program counter (PC) served as the ring register. Thus code executing with the virtual PC set to 0xE200000, for example, would automatically be in ring 7, and calling a subroutine in a different section of memory would automatically cause a ring transfer. The hardware severely restricts the ways in which control can be passed from one ring to another, and also enforces restrictions on the types of memory access that can be performed across rings. Using x86 as an example, there is a special
gate structure which is referenced by the
call instruction that transfers control in a secure way towards predefined entry points in lower-level (more trusted) rings; this functions as a
supervisor call in many operating systems that use the ring architecture. The hardware restrictions are designed to limit opportunities for accidental or malicious breaches of security. In addition, the most privileged ring may be given special capabilities (such as real memory addressing that bypasses the virtual memory hardware).
ARM version 7 architecture implements three privilege levels: application (PL0), operating system (PL1), and hypervisor (PL2). Unusually, level 0 (PL0) is the least-privileged level, while level 2 is the most-privileged level. ARM version 8 implements four exception levels: application (EL0), operating system (EL1), hypervisor (EL2), and secure monitor / firmware (EL3), for AArch64 and AArch32. ==Modes==