Microsoft Windows Architecture for Developers Training Kit

The Windows operating system uses two modes to maintain operating system efficiency and integrity: user mode and kernel mode. The architecture of 80386 and higher processors defines four privilege levels, called rings , to protect system code and data from being overwritten inadvertently or maliciously by less privileged code. This is called the Intel Protection model.

Figure 1.2 Rings 0 and 3 of the Intel Protection model

The 0 (zero) privilege level, also known as kernel mode , is the most privileged level. Privilege level 3, or user mode , is the least privileged. When code is running at a given privilege level, it is said to be running in that ring. For example, code running at privilege level 0 is said to run in ring 0. The Windows operating system only uses rings 0 and 3.

Kernel Mode

Kernel mode (ring 0) is the privileged mode of operation in which code has direct access to all hardware and all memory addresses. Software that runs in kernel mode has the following attributes:

Windows 95 and Windows NT core operating system code runs in kernel mode (ring 0). Because kernel mode components are protected by the processor architecture, the processor prevents one program from writing over another's components. Although ring 0 provides this kind of protection, not everything can run in ring 0 because components have access to the entire system. If a software component fails in ring 0, it can halt the entire system.

Because Windows 95 is designed to be as backwards compatible as possible, many older 16-bit device drivers and applications need direct access to hardware. Windows NT does not provide this level of access, and therefore not all legacy applications will run successfully under Windows NT Workstation and Windows NT Server.

User Mode

User mode (ring 3) is a less privileged processor mode than kernel mode and has no direct access to hardware. Code running in user mode can run only in its own address space. It uses the Windows APIs to request system services.

User mode processes:

Категории