- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
User Mode vs Kernel Mode
There are two modes of operation in the operating system to make sure it works correctly. These are user mode and kernel mode.
They are explained as follows −
The system is in user mode when the operating system is running a user application such as handling a text editor. The transition from user mode to kernel mode occurs when the application requests the help of operating system or an interrupt or a system call occurs.
The mode bit is set to 1 in the user mode. It is changed from 1 to 0 when switching from user mode to kernel mode.
The system starts in kernel mode when it boots and after the operating system is loaded, it executes applications in user mode. There are some privileged instructions that can only be executed in kernel mode.
These are interrupt instructions, input output management etc. If the privileged instructions are executed in user mode, it is illegal and a trap is generated.
The mode bit is set to 0 in the kernel mode. It is changed from 0 to 1 when switching from kernel mode to user mode.
An image that illustrates the transition from user mode to kernel mode and back again is −
In the above image, the user process executes in the user mode until it gets a system call. Then a system trap is generated and the mode bit is set to zero. The system call gets executed in kernel mode. After the execution is completed, again a system trap is generated and the mode bit is set to 1. The system control returns to kernel mode and the process execution continues.
Necessity of Dual Mode (User Mode and Kernel Mode) in Operating System
The lack of a dual mode i.e user mode and kernel mode in an operating system can cause serious problems. Some of these are −
- A running user program can accidentaly wipe out the operating system by overwriting it with user data.
- Multiple processes can write in the same system at the same time, with disastrous results.
These problems could have occurred in the MS-DOS operating system which had no mode bit and so no dual mode.
- Supervisor Mode (Privileged Mode)
- Dual-Mode and Multi-Mode Operation in Operating System
- Difference between Memory Address Mode and Register Address Mode.
- Hot Standby Mode
- Enhancement Mode MOSFET
- Asynchronous Transfer Mode (ATM)
- Android Debug Bridge Mode
- Strict Mode in ReactJS
- Differentiate between infrastructure mode and the ad hoc mode of IEEE 802.11
- Differentiate between ad-hoc mode and Wi-Fi Direct mode in 802.11 architecture
- CSS animation-fill-mode property
- CSS background-blend-mode Property
- Prompt mode in 8085 Microprocessor
- Command mode in 8085 Microprocessor
- Intel 8212 in mode 0