加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

User mode and kernel mode (from MSDN)

发布时间:2020-12-14 05:59:22 所属栏目:Windows 来源:网络整理
导读:A processor in a computer running Windows has two different modes: user mode and kernel mode . The processor switches between the two modes depending on what type of code is running on the processor. Applications run in user mode,and core

A processor in a computer running Windows has two different modes: user mode and kernel mode. The processor switches between the two modes depending on what type of code is running on the processor. Applications run in user mode,and core operating system components run in kernel mode. While many drivers run in kernel mode,some drivers may run in user mode (see?User-Mode Driver Framework (UMDF)).

When you start a user-mode application,Windows creates a process for the application. The process provides the application with a private virtual address space and a private handle table. Because an application‘s virtual address space is private,one application cannot alter data that belongs to another application. Each application runs in isolation,and if an application crashes,the crash is limited to that one application. Other applications and the operating system are not affected by the crash.

In addition to being private,the virtual address space of a user-mode application is limited. A processor running in user mode cannot access virtual addresses that are reserved for the operating system. Limiting the virtual address space of a user-mode application prevents the application from altering,and possibly damaging,critical operating system data.

All code that runs in kernel mode shares a single virtual address space. This means that a kernel-mode driver is not isolated from other drivers and the operating system itself. If a kernel-mode driver accidentally writes to the wrong virtual address,data that belongs to the operating system or another driver could be compromised. If a kernel-mode driver crashes,the entire operating system crashes.

This diagram illustrates communication between user-mode and kernel-mode components.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读