Sei sulla pagina 1di 9

System Calls

System Calls
In computing, a system call is how a program requests a service from an operating system's kernel that it does not normally have permission to run. System calls provide the interface between a process and the operating system. Most operations interacting with the system require permissions not available to a user level process, e.g. I/O performed with a device present on the system, or any form of communication with other processes requires the use of system calls.

Privileges
The design of the microprocessor architecture practically on all modern systems (except some embedded systems) offers a series of CPU modes The (low) privilege level in which normal applications execute limits the address space of the program so that it cannot access or modify other running applications nor the operating system itself. It also prevents the application from directly using devices (e.g. the frame buffer or network devices). But obviously many normal applications need these abilities; therefore, predefined system calls are made available by the operating system. The operating system executes at the highest level of privilege, and allows applications to request services via system calls, which are often implemented through interrupts.

Privileges
If allowed, the system enters a higher privilege level, executes a specific set of instructions over which the interrupting program has no direct control, returns to the calling application's privilege level, then returns control to the calling application. This concept also serves as a way to implement security. With the development of separate operating modes with varying levels of privilege, a mechanism was needed for transferring control safely from lesser privileged modes to higher privileged modes.

Library as an Intermediary
Generally, systems provide a library or API that sits between normal programs and the operating system, that provides functions for the system calls, The library's wrapper functions expose an ordinary function calling convention (a subroutine call on the assembly level) for using the system call, as well as making the use of the system call more modular. In this way the library, which exists between the OS and the application, increases portability.

Groups of System Calls


Process Control.
load execute create process terminate process get/set process attributes Wait for time, wait event, signal event allocate, free memory

Groups of System Calls


File management.
create file, delete file open, close read, write, reposition get/set file attributes

Groups of System Calls


Device Management.
request device, release device read, write, reposition get/set device attributes logically attach or detach devices

Groups of System Calls


Information Maintenance.
get/set time or date get/set system data get/set process, file, or device attributes

Communication.
create, delete communication connection send, receive messages transfer status information attach or detach remote devices

Potrebbero piacerti anche