System call provides an interface between a running program and operating system. It allows user to access services provided by operating system. This system calls are procedures written using C, C++ and assembly language instructions. Each operating system has its own name for each system call. Each system call is associated with a number that identifies itself.
System calls:
Process Control: Program in execution is a process. A process to be executed must be loaded in main memory. while executing it may need to wait, terminate or create & terminate child processes.
end, abort
load, execute
create process, terminate process
get process attributes, set process attributes
wait for time
wait event, signal event
allocate and free memory
File Management: System allows us to create and delete files. For create and delete operation system call requires the name of the file and other attributes of the file. File attributes include file type, file size, protection codes, accounting information and so on. Systems access these attributes for performing operations on file and directories. Once the file is created, we can open it and use it. System also allows performing reading, writing or repositioning operations on file.
create file, delete file
open, close
read, write, reposition
get file attributes, set device attributes
logically attach or detach devices
3. Device Management: When a process is in running state, it requires several resources to execute. These resources include main memory, disk drives, files and so on. If the resource is available, it is assigned to the process. Once the resource is allocated to the process, process can read, write and reposition the device.
request device, release device
read, write, reposition
get device attributes, set device attributes
logically attach or detach devices
4. Information Maintenance: Transferring information between the user program and the operating system requires system call. System information includes displaying current date and time, the number of current user, the version number of the operating system, the amount of free memory or disk space and so on. Operating system keeps information about all its processes that can be accessed with system calls such as get process attributes and set process attributes.
get time or date, set time or date
get system data, set system data
get process, file, or devices attributes
set process, file, or devices attributes
5. Communication: Processes in the system, communicate with each other. Communication is done by using two models: message passing and shared memory. For transferring messages, sender process connects itself to receiving process by specifying receiving process name or identity. Once the communication is over system close the connection between communicating processes.
create, delete communication connection
send, receive messages
transfer status information
attach or detach remote devices.