System Programs and Calls

Rating - 3/5

System Calls and Programs
All the present-day operating systems support the following two modes of operation for the CPU:

  1. User mode
  2. Kernel mode


Fig. Modes supported by the operating system

User Mode:

When the CPU is in user mode, programs can’t access memory and hardware directly.

These Topics Are Also In Your Syllabus
1 Network Operating System link
2 Real Time operating System link
You May Find Something Very Interesting Here. link
3 Various Operating system services link
4 Architectures of Operating System link
5 Types Of Systems link

Moreover, if a program crashes in user mode, its effect is limited to that program only. Hence, the programs are in a safe state in this mode.

Most of the programs are in user mode only. But whenever some privileged instructions, error handling, exception handling, hardware access or other hardware related access needs to be invoked, there is a switch from user mode to kernel mode.

Kernel Mode:

While the CPU is in kernel mode, programs can directly access the memory as well as hardware. All the privileged commands are executed in this mode only. Also, if a program fails in kernel mode then the entire system will halt.

All the important library functions, subroutines etc. all are executed here only. Here user has nothing to do and the kernel only accesses the hardware to provide the requested service.

These Topics Are Also In Your Syllabus
1 Deadlock prevention link
2 Deadlock Avoidance link
You May Find Something Very Interesting Here. link
3 Deadlock Recovery link
4 Stable Storage Implementation link
5 File System Mounting link

Context Switch:

Initially a program is always in the user mode, whenever it invokes any privileged command, control is transferred from user mode to kernel mode. As soon as OS is done with its work and the service has been provided, again there is a transfer from the kernel mode to user mode. This switching among the two modes is called context switch.

System Call:

System call is a call that is invoked whenever, a program needs to access hardware, do some I/O operation or some exception or interrupt has arisen. In other words, system call is a call which in invoked for a context switch from the user mode to the kernel mode.

System Program:

These Topics Are Also In Your Syllabus
1 Monolithic architecture - operating system link
2 Layered Architecture of Operating System link
You May Find Something Very Interesting Here. link
3 Microkernel Architecture of operating system link
4 Hybrid Architecture of Operating System link
5 System Programs and Calls link

A system program is nothing but a special utility program that creates a user-friendly environment where the user can perform his desired work efficiently.

Operating system, interpreter, compiler, editor etc. are all system programs. They provide a built-in environment to the user where several necessary functions like the ones for compiling, editing, interrupt handling, memory management etc. are already defined and hence the user does not need to write any code for such functions.

Rating - 3/5

Rating - 3/5