Kernel Mode Vs User Mode
Kernel Mode Vs User Mode
11/10/24 2
What is the Kernal?
11/10/24 5
• Resource Management
• Xwindow- Graphical User Interface
• Sudo followed by command name – Super user
do – file extraction not allowed inside the file
system.
11/10/24 6
11/10/24 7
11/10/24 8
Kernel types
• Monolithic
o All OS related code are stuffed in a single module
o Available as a single file
o Advantage : Faster functioning
• Micro
o OS components are isolated and run in their own address
space
o Device drivers, programs and system services run
outside kernel memory space.Only a few functions such
as process scheduling, and interprocess communication
are included into the microkernel
o Supports modularity & Lesser in size
11/10/24 9
11/10/24 10
Kernel Mode(Privileged Mode)
11/10/24 12
• A good example of this would be device
drivers.
• A device driver must tell the kernel exactly
how to interact with a piece of hardware, so it
must be run in kernel mode.
• Because of this close interaction with the
kernel, the kernel is also a lot more vulnerable
to programs running in this mode, so it
becomes highly crucial that drivers are
11/10/24 13
System Call
• A system call is a request to the kernel in a Unix operating
system by an active process for a service performed by the
kernel.
11/10/24 17
Switching from User Mode to Kernel
Mode
When do we switch?
Once we understand that there are 2 different
modes, we have to know when we switch from
one to the other.
Typically, there are 2 points of switching:
11/10/24 18
SWITCHING FROM USER MODE TO KERNEL MODE
11/10/24 20
Interrupt
USER Mode
Computer
Hardware
11/10/24 22
Kernel Mode "prevents" User Mode applications
from damaging the system or its features.
11/10/24 23
System Calls
11/10/24 24
Shell
Program that interacts with kernel
Command interpreter
2 11/10/24
5
Types of Shell
Sh – simple shell
CSH – C Shell
To use a particular shell type the shell name at the command prompt.
To view the current shell that is being used, type echo $SHELL at the
command prompt
2 11/10/24
6
11/10/24 27
11/10/24 28
11/10/24 29