What are system calls? Explain any five system calls.

Subject: Operating System

Topic: Operating System Overview

Difficulty: High

1 Answer
  • System calls provide an interface to the services made available by an operating system.
  • We know that there are two main modes in the operation of the system, that is the user mode and kernel mode.
    • User mode: All user processes are executed.
    • System mode: All privileged operations are executed.
  • However many a times user-mode programs need to execute some privileged operations in kernel-mode. Since processor prevents direct access to kernel-mode functions, we need to use an interface.
  • Definition: System calls provide an interface to the services made available by an operating system.
  • System calls expose all kernel functionalities that user-mode programs require.
  • The main advantage of system calls is security. Due to system calls a user program is not able to enter into the OS or any other users region.
  • Similarly, I/O devices are free from any misuse by the user.
Calls Description
Open() A program initializes access to a file in a file system using the open system call.
Read() A program that needs to access data from a file stored in a file system uses the read system call.
Write() It writes data from a buffer declared by the user to a given device, maybe a file. This is primary way to output data from a program by directly using a system call.
Exec() exec is a functionality of an operating system that runs an executable file in the context of an already existing process, replacing the previous executable
Fork() fork is an operation whereby a process creates a copy of itself. Fork is the primary method of process creation on Unix-like operating systems.
Please log in to add an answer.

Continue reading...

The best way to discover useful content is by searching it.