what is user mode & kernel mode?

Answer Posted / mohan l

A process can run in two modes:
1.User Mode.
2.Kernel Mode.
1.User Mode:
=>A mode of the CPU when running a program.
=>In this mode ,the user process has no access to the
memory locations used by the kernel.When a program is
running in User Mode, it cannot directly access the kernel
data structures or the kernel programs.

2.Kernal Mode:
=>A mode of the CPU when running a program.
=>In this mode, it is the kernel that is running on behalf
of the user process and directly access the kernel data
structures or the kernel programs.Once the system call
returns,the CPU switches back to user mode.


When you execute a C program,the CPU runs in user mode till
the system call is invoked.In this mode,the user process has
access to a limited section of the computer's memory and can
execute a restricted set of machine
instructions.however,when the process invokes a system
call,the CPU switches from user mode to a
more privileged mode ­the kernel. In this mode ,it is the
kernel that runs on behalf of the user process,but it has
access to any memory location and can execute any machine
instruction. After the system call has returned,the CPU
switches back to user mode.

Is This Answer Correct ?    74 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What command would you use to check how much memory is being used by linux?

556


What is grep command in linux with examples?

551


Explain about communication features in UNIX?

621


Who linux commands?

558


How do I run bash on windows?

506






What is umask in linux?

537


How do I run whois command?

506


What is file and example?

612


What is the command to calculate the size of a folder?

517


In order to improve your system’s security you decide to implement shadow passwords. What command should you use?

536


How do I know my shell?

539


What is du -s * | sort -k1,1rn | head command used for?

534


Describe the mknod command and when you’d use it.

545


What is cd command used for?

562


What are the linux commands used in devops?

554