System call

format_list_bulleted Contenido keyboard_arrow_down
ImprimirCitar
The GNU C library provides functionality that isolates core applications (Linux in this image). The syscall() routine of the GNU C library is used to use specific Linux functionality. Or a proper implementation of the system call in assembly. If an application uses the Linux system call interface with its own exclusive implementations, then that application is considered monolithic.

In computing, system call is the mechanism used by an application to request a service from the operating system.

Mechanism

System calls commonly use a special CPU instruction that causes the processor to pass control to privileged code (usually the kernel), previously specified. This allows the privileged code to specify where it is to be connected to as well as the state of the processor.

When a system call is invoked, the execution of the calling program is interrupted and its data is saved, usually on its PCB (Process Control Block), so that it can continue executing later. The processor then begins executing the low-privilege code instructions to perform the required task. When it ends, it returns to the original process, and continues its execution. The return to the requesting process is not necessarily immediate, it depends on the execution time of the system call and the CPU scheduling algorithm.

Libraries as intermediaries

Generally, operating systems provide libraries that link user programs and the rest of the operating system, usually a C runtime library such as GNU's glibc or Microsoft's C library. This library handles, among other things, the low-level details of transferring information to the kernel and switching to supervisor mode, as well as any data processing or tasks that need to be performed in supervisor mode. Ideally, this reduces the dependency between the operating system and the application and software, and increases its portability.

Examples and tools

In operating systems under the POSIX standard or similar, some widely used system calls are open, Read (system call), write, close, wait, exec, fork, exit and kill. Current operating systems have hundreds of calls, for example Linux 2.x and FreeBSD have over 300.

Typical Implementations

The implementation of system calls requires transfer control that involves specific features of the processor architecture. A typical way to implement is to use a software interrupt. Linux uses this implementation on the x86 architecture.

For RISC architecture processors, this is the only way, but CISC architectures like x86 support additional techniques. An example is SYSCALL/SYSENTER.

Contenido relacionado

Minesweeper

Minesweeper, minesweeper, minesweeper, minesweeper or mine detector en a ship whose main mission and objective is the identification and destruction of marine...

Annex: XML dialects

This is a list of XML...

Roaming

Roaming is a term used in telecommunications to refer to the ability of a wireless device to use a network coverage other than the main one. This allows you...
Más resultados...
Tamaño del texto:
undoredo
format_boldformat_italicformat_underlinedstrikethrough_ssuperscriptsubscriptlink
save