What is the difference between user and kernel modes in operating systems?

后端 未结 7 1918
长发绾君心
长发绾君心 2020-12-02 04:31

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?

7条回答
  •  爱一瞬间的悲伤
    2020-12-02 04:46

    1. Kernel Mode

      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.

    2. User Mode

      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.

    Read more

    Understanding User and Kernel Mode

提交回复
热议问题