Difference between processes running in kernel mode and running as root?

萝らか妹 提交于 2019-12-09 09:20:41

问题


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?


回答1:


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.

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).

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.



来源:https://stackoverflow.com/questions/2354125/difference-between-processes-running-in-kernel-mode-and-running-as-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!