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

How do I run a script in linux?

762


What is df -h command?

900


How do you create a text file in linux terminal?

707


Explain about sh?

771


What is a simple command?

776


What is cpu in linux?

753


What is SFC command?

668


How do I run a .sh file in linux?

799


What is ls command and what it does?

755


What is the use of ls command?

743


How to activate / deploy licence in RHEL 6 and what will happen if you don't activate / deploy licence in RHEL 6 ?

2454


Write about an internal command.

784


What is phony in makefile?

731


What does execute mean in linux?

762


What is command example?

750