Template Information

Trang

User Space and Kernel Space

Thứ Bảy, 4 tháng 6, 2011 / 20:29

A module runs in kernel space, whereas applications run in user space. This concept
is at the base of operating systems theory.
The role of the operating system, in practice, is to provide programs with a consistent
view of the computer’s hardware. In addition, the operating system must
account for independent operation of programs and protection against unauthorized
access to resources. This nontrivial task is possible only if the CPU enforces protection
of system software from the applications.
Every modern processor is able to enforce this behavior. The chosen approach is to
implement different operating modalities (or levels)in the CPU itself. The levels have
different roles, and some operations are disallowed at the lower levels; program code
can switch from one level to another only through a limited number of gates. Unix
systems are designed to take advantage of this hardware feature, using two such levels.
All current processors have at least two protection levels, and some, like the x86
family, have more levels; when several levels exist, the highest and lowest levels are
used. Under Unix, the kernel executes in the highest level (also called supervisor
mode), where everything is allowed, whereas applications execute in the lowest level
(the so-called user mode), where the processor regulates direct access to hardware
and unauthorized access to memory.

0 nhận xét:

Đăng nhận xét