Different Types of System Calls in OS (original) (raw)

Last Updated : 18 Dec, 2025

System calls are the interface between user programs and the operating system, allowing applications to request services like file access, process control, or device handling. They are the only way for a program to switch from user mode to kernel mode and safely use system resources managed by the kernel.

Types of System Calls

Services provided by an OS are typically related to any kind of operation that a user program can perform like creation, termination, forking, moving, communication, etc. Similar types of operations are grouped into one single system call category. System calls are classified into the following categories:

Types-of-System-Calls

Types of System Calls

1. File System Operations

These system calls are made while working with files in OS, File manipulation operations such as creation, deletion, termination etc.

2. Process Control

These types of system calls deal with process creation, process termination, process allocation, deallocation etc. Basically manages all the process that are a part of OS.

3. Memory Management

These types of system calls deals with memory allocation, deallocation & dynamically changing the size of a memory allocated to a process. In short, the overall management of memory is done by making these system calls.

4. Interprocess Communication (IPC)

When two or more process are required to communicate, then various IPC mechanism are used by the OS which involves making numerous system calls. Some of them are :

5. Device Management

The device management system calls are used to interact with various peripherial devices attached to the PC or even the management of the current device.

**What is The Purpose of System Calls in OS?

System Calls act as a bridge between an operating system (OS) and a running program. They are usually written as assembly language instructions and are detailed in manuals for programmers working with assembly language.

When a program running in user mode needs to access a resource, it makes a System Call. This request is sent to the OS kernel to obtain the needed resource.

System Calls are used for various tasks, such as:

Methods to Pass Parameters to OS

If a system call occur, we have to pass parameter to the Kernel part of the Operating system. for example look at the given **open() system call:

C `

// Example showing how parameters are passed from user program to OS using open() system call

#include <fcntl.h> #include <unistd.h> #include <stdio.h>

int main() { int fd = open("test.txt", O_CREAT | O_RDWR, 0644); if (fd < 0) { perror("open failed"); return 1; }

write(fd, "Hello OS\n", 9);
close(fd);

printf("File created and data written successfully.\n");
return 0;

}

`

Here pathname, flags and mode_t are the parameters. So it is to be noted that :

So we can't run it in the normal address space that the process had already created and hence we can't place the parameters in the top of the stack because it is not available to the kernel of the operating system for processing. so we have to adopt any other methods to pass the parameters to the kernel of the OS. We can done it through,

  1. Passing parameters in registers
  2. Address of the block is passed as a parameter in a register.
  3. Parameters are pushed into a stack.

1. Passing Parameters in Registers

2. Address of The Block is Passed as Parameters

3. Parameters Are Pushed in a Stack