Modules, User Space and Kernel Space
来源:互联网 发布:模特兼职知乎 编辑:程序博客网 时间:2024/05/01 01:37
Modules, User Space and Kernel Space
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.
We usually refer to the execution modes as kernel space and user space. These terms encompass not only the different privilege levels inherent in the two modes, but also the fact that each mode can have its own memory mapping—its own address space—as well.
Unix transfers execution from user space to kernel space whenever an application issues a system call or is suspended by a hardware interrupt. Kernel code executing a system call is working in the context of a process—it operates on behalf of the calling process and is able to access data in the process's address space. Code that handles interrupts, on the other hand, is asynchronous with respect to processes and is not related to any particular process.
The role of a module is to extend kernel functionality; modularized code runs in kernel space. Usually a driver performs both the tasks outlined previously: some functions in the module are executed as part of system calls, and some are in charge of interrupt handling.
- Modules, User Space and Kernel Space
- kernel space and user space
- Kernel space DMA and User space DMA
- Kernel space DMA and User space DMA
- Kernel Space - User Space Interfaces_Mmap
- user space to kernel space
- Kernel Space - User Space Interfaces
- Kernel Space - User Space Interfaces
- kernel space vs user space
- User space和Kernel space
- Netlink通信kernel and user space
- Avoid memory copying between user space and kernel space
- linux i2c access in kernel and user space
- Clarification of General Concepts- User Space , Kernel Space and PGD and CR3
- iocrl如何从user space调用到 kernel space,
- 内核空间(kernel-space) VS 用户空间(user-space)
- Linux-System-Call and User Space
- User space程序读取kernel log 并保存
- 孙鑫VC学习(第16课:线程同步与异步套接字编程)
- 第一篇博文
- 水果皮的妙用
- 跟我一起学MiniOA:第一章 1.3 JSF标签参考(连载)
- 继承体系中 destructor 的执行次序
- Modules, User Space and Kernel Space
- Android audio codec power consumption
- 在qtopia中添加应用_arm-qtopia(基于mini2440-Friendly)
- 跟我一起学MiniOA:第一章 1.4 Richfaces控件(连载)
- 孙鑫VC学习(第13课--文档与串行化)
- Excel列名与数字的相互转换
- UIImage应用与内存管理
- 银行业务调度系统
- 基于GPT和ZFS的FreeBSD安装