以内核模式运行和以root用户运行的进程之间的区别? [英] Difference between processes running in kernel mode and running as root?

查看:228
本文介绍了以内核模式运行和以root用户运行的进程之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道以用户模式运行的进程与以内核模式运行的进程之间的区别(基于访问限制,对硬件的访问等).但是出于好奇,以内核模式运行的进程与以root用户运行的进程有什么区别?

I am aware of the difference between a process running in user mode and one running in kernel mode (based on access restrictions, access to hardware etc.). But just out of curiosity, what is the difference between a process running in kernel mode and one running as root?

推荐答案

内核模式和root是两个彼此无关的想法.以root身份运行进程的概念是unix/linux术语,表示您以系统管理员身份登录.

kernel mode and root are two separate ideas that aren't really related to each other. The concept of running a process as root is a unix/linux term that means you're logged in as the administrator of the system.

您以root用户或普通用户身份运行的任何进程通常都在用户模式和内核模式下运行.系统不断在用户模式(运行应用程序代码的位置)和内核模式(运行内核代码的位置)之间切换.

Any process you run, whether as root or a normal user, generally runs in both user mode and kernel mode. The system is continually switching between user mode (where the application code runs) and kernel mode (where the kernel code runs).

某些程序(例如许多设备驱动程序)始终以内核模式运行,这意味着它们具有对硬件的完全访问权限.在用户模式下,仍然具有以root特权运行的普通应用程序,并且只有在调用内核系统时才切换到内核模式,然后再切换回用户模式.

Some programs, like many device drivers, always run in kernel mode, meaning they have full access to the hardware. A normal application running with root privileges still exists in user mode and only switches to kernel mode when a kernel system call is made and then switches right back to user mode.

这篇关于以内核模式运行和以root用户运行的进程之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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