System Calls - aryanjoshi0823/5143-Operating-System GitHub Wiki

What is a System Call?

A system call is a method for programs to request services from the OS kernel, acting as an interface between user programs and the kernel. The Application Program Interface (API) connects OS functions to user programs, making system calls the only way to access kernel-level operations. System calls are essential for programs that need to use system resources.


How Are System Calls Made?

When a program requires access to kernel services, it makes a system call via an API. This is the sole method to interact with the kernel. System calls have specific attributes:

  • They can create and utilize kernel processes for asynchronous processing.
  • They execute with kernel-mode privileges.
  • They do not rely on shared libraries outside the kernel protection domain.
  • Their code and data reside in global kernel memory.

How System Calls Work?

Applications run in user space, while the OS kernel operates in kernel space. A system call connects these two spaces:

  1. The application requests a service.
  2. The kernel validates the request using an interrupt and performs the action if permitted.
  3. Results are transferred from kernel space to user space.
  4. The application resumes execution with the results.

Modern multi-threaded OSs can handle multiple system calls simultaneously, optimizing performance.

⚠️ **GitHub.com Fallback** ⚠️