Sunday, May 16, 2021
Daily Tech Updates


System Calls What Are They And What Are They Used For

In today’s world, operating systems must offer users not only the greatest possible comfort but also maximum stability and security….

By TrendsTechBlog , in TECHNOLOGY , at May 18, 2020 Tags: ,

In today’s world, operating systems must offer users not only the greatest possible comfort but also maximum stability and security. For this, the developers of systems such as Linux or Windows take care, among other things, of minimizing the risk of possible complications in the system caused by involuntary personal negligence or by attacks directed from the outside. One of the most important measures taken for this purpose is the strict separation of the core of the operating system and the application programs or user processes. This means that the programs and processes that do not belong to the system do not have direct access to the CPU and memory, but depend on system calls.

What Is A System Call (syscall)

A system call or system call is a method used by application programs to communicate with the system core. In modern operating systems, this is necessary when an application or user process needs to transmit to or read information from the hardware, other processes, or the kernel itself. In this way, the call is the link point between user mode and kernel mode, the two crucial privileges and security modes for processing CPU instructions on computer systems.

Before the system call finishes processing and the corresponding data is transmitted or received, the system core takes control of the program or process. Execution is interrupted during this period. After the action requested by a system call is performed, the kernel relinquishes control and the code continues from the point where the system call was previously initiated.

What Are The System Calls Needed For

The call system is closely linked to the modern model of operating system user mode and kernel mode, introduced in response to the increasing number of processes running simultaneously in the main memory (RAM) of the computer. In this way, each process has its data with special access rights, and only if resources are properly distributed can the system and programs run as expected.

The most privileged core mode here is the decisive control instance, because, as we mentioned, in this not only all the services and processes of the system itself are executed, but also the critical actions of the system of the application programs than in the user mode are locked. For this, the program needs to make a system call, which in most cases is simply a matter of access to computing power (CPU) or memory structures (working memory and hard disk space).

What Types Of System Calls Are There

In principle, as stated above, all system calls can be used as control units for communication between application processes and the operating system or hardware. Established system calls can also be classified into different categories, so these five types have been established in particular :

  • Process Control: all the processes of a computer system must be controlled so that at any time they can be stopped or other processes can direct them. For this, system calls in this category monitor, for example, the start/run or stop / end of processes.
  • File Management: Application programs require this type of system call to access typical file operations. These file manipulation methods include create, delete, open, close, write, and read ( create, delete, open, close, write, and read ).
  • Device Management: The “Device Management” category includes all system calls that are used to request or manage the necessary hardware resources, such as computing power or storage space.
  • Information Management: processes have a lot of information associated with them, and punctuality and integrity are very important. To exchange or request information, application programs use system calls for information management or maintenance.
  • Inter-Process Communication: Smooth interaction between the operating system and the various application programs can only be guaranteed if the individual processes are coordinated. To this end, communication through the corresponding system calls is essential.

Windows And Linux: An Overview Of System Calls

The extent to which the listed types of system calls can be implemented or made depends primarily on the hardware and system architecture used, but also on the operating system. In Linux, for example, system calls are stored directly in the Linux kernel in the “System Call Table”. Each entry in this table is assigned a unique number and a specific function that will run in kernel mode. To execute any Linux system call, the number is loaded into the CPU memory and then loaded by a software interrupt128 (call to a subfunction of the operating system that interrupts the execution of the program in the user mode).

The functionality is similar in Windows operating systems, but here a system call is always converted internally first: a Windows API library function (short for WinAPI) is automatically converted into a system call that the operating system can read, including a unique number that refers to the desired function in kernel mode.

Also Read: Graph Neural Network: One Step Further In Deep Learning