内核空间和用户空间有什么区别? [英] What is the difference between the kernel space and the user space?

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

问题描述

内核空间和用户空间有什么区别?内核空间,内核线程,内核进程和内核堆栈是否具有相同的含义?另外,为什么我们需要这种差异化?

真的简化的答案是,内核运行在内核空间中,普通程序运行在用户空间中.用户空间基本上是沙盒的一种形式-它限制了用户程序,因此它们不会弄乱其他程序或OS内核拥有的内存(和其他资源).这样会限制(但通常不能完全消除)他们执行坏事(例如使机器崩溃)的能力.

内核是操作系统的核心.通常,它可以完全访问所有内存和计算机硬件(以及计算机上的所有其他内容).为了使机器尽可能稳定,通常只希望在内核模式/内核空间中运行最受信任的,经过良好测试的代码.

堆栈只是内存的另一部分,因此自然而然地将它与其余的内存隔离开了.

What is the difference between the kernel space and the user space? Do kernel space, kernel threads, kernel processes and kernel stack mean the same thing? Also, why do we need this differentiation?

解决方案

The really simplified answer is that the kernel runs in kernel space, and normal programs run in user space. User space is basically a form of sand-boxing -- it restricts user programs so they can't mess with memory (and other resources) owned by other programs or by the OS kernel. This limits (but usually doesn't entirely eliminate) their ability to do bad things like crashing the machine.

The kernel is the core of the operating system. It normally has full access to all memory and machine hardware (and everything else on the machine). To keep the machine as stable as possible, you normally want only the most trusted, well-tested code to run in kernel mode/kernel space.

The stack is just another part of memory, so naturally it's segregated right along with the rest of memory.

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

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