Monday, 1 May 2023

Processor and User Modes in Operating System

 The user mode and kernel mode of a CPU on a computer running Windows are two different operating systems.

Depending on the type of code it is running, the processor switches between the two modes. User mode is used for applications, whereas kernel mode is used for the essential parts of the operating system. Some drivers may operate in user mode, though the majority operate in kernel mode.

User Mode in Operating System 

When you start a user-mode application, Windows creates a process for the application. 

The process provides the application with a private virtual address space and a private handle table. Because an application's virtual address space is private, one application can't alter data that belongs to another application. 

Each application runs in isolation, and if an application crashes, the crash is limited to that one application. Other applications and the operating system aren't affected by the crash.

A user-mode application's virtual address space is constrained in addition to being private. Virtual addresses that are set aside for the operating system cannot be accessed by a process running in user mode. A user-mode application's virtual address area can be restricted to stop it from changing and potentially harming crucial operating system data.

Processor / Kernel Mode in Operating System 

A single virtual address space is shared by all kernel mode code. A kernel-mode driver isn't separate from other drivers or the operating system as a whole because of this. Data belonging to the operating system or another driver may be compromised if a kernel-mode driver unintentionally writes to the incorrect virtual address. The entire operating system fails if a kernel-mode driver malfunctions.

The interaction between kernel-mode and user-mode components is shown in this figure.

  • User mode when executing harmless code in user applications
  • Kernel mode ( a.k.a. system mode, supervisor mode, privileged mode ) when executing potentially dangerous code in the system kernel.
  • Certain machine instructions ( privileged instructions ) can only be executed in kernel mode.
  • Kernel mode can only be entered by making system calls. User code cannot flip the mode switch.
  • Modern computers support dual-mode operation in hardware, and therefore most modern OSes support dual-mode operation.


Post a Comment

Note: only a member of this blog may post a comment.

Find Us On Facebook

python tutorial


C Programming


Java Tutorial


Data Structures


MS Office


Database Management