操作系统中的用户模式和内核模式有什么区别? [英] What is the difference between user and kernel modes in operating systems?

查看:20
本文介绍了操作系统中的用户模式和内核模式有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户模式和内核模式有什么区别,为什么以及如何激活它们,它们的用例是什么?

What are the differences between User Mode and Kernel Mode, why and how do you activate either of them, and what are their use cases?

推荐答案

  1. 内核模式

  1. Kernel Mode

在内核模式下,执行的代码是完整且不受限制的访问底层硬件.它可以执行任何 CPU 指令并且引用任何内存地址.核心模式通常保留给最底层、最受信任的函数的操作系统.崩溃内核模式是灾难性的;他们将停止整个 PC.

In Kernel mode, the executing code has complete and unrestricted access to the underlying hardware. It can execute any CPU instruction and reference any memory address. Kernel mode is generally reserved for the lowest-level, most trusted functions of the operating system. Crashes in kernel mode are catastrophic; they will halt the entire PC.

用户模式

在用户模式下,执行代码无法直接访问硬件或参考内存.代码在用户模式下运行必须委托给用于访问硬件的系统 API 或记忆.由于提供的保护通过这种隔离,崩溃用户模式始终是可恢复的.最多在您的计算机上运行的代码将在用户模式下执行.

In User mode, the executing code has no ability to directly access hardware or reference memory. Code running in user mode must delegate to system APIs to access hardware or memory. Due to the protection afforded by this sort of isolation, crashes in user mode are always recoverable. Most of the code running on your computer will execute in user mode.

阅读更多

了解用户和内核模式

这篇关于操作系统中的用户模式和内核模式有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆