1.13. System Calls¶

../_images/sys_call.png

The organization call provides an interface to the operating arrangement services.

Application developers frequently do not have directly access to the organisation calls, just can access them through an application programming interface (API). The functions that are included in the API invoke the actual organization calls. By using the API, certain benefits can be gained:

  • Portability: as long a arrangement supports an API, any plan using that API tin can compile and run.
  • Ease of Apply: using the API can exist significantly easier than using the actual organisation telephone call.

1.13.i. System Telephone call Parameters¶

3 general methods be for passing parameters to the OS:

  1. Parameters tin be passed in registers.
  2. When at that place are more than parameters than registers, parameters can be stored in a block and the block address can be passed as a parameter to a register.
  3. Parameters tin can as well be pushed on or popped off the stack past the operating system.

../_images/sys_call_param.png

1.thirteen.2. Types of Organization Calls¶

There are v dissimilar categories of system calls:
process control, file manipulation, device manipulation, information maintenance, and communication.

one.13.two.1. Process Command¶

A running program needs to exist able to stop execution either normally or abnormally. When execution is stopped abnormally, often a dump of retentivity is taken and tin can be examined with a debugger.

i.13.2.ii. File Management¶

Some common system calls are create, delete, read, write, reposition, or close. Also, there is a demand to make up one's mind the file attributes – go and set file attribute. Many times the OS provides an API to make these system calls.

i.xiii.2.three. Device Management¶

Process commonly require several resources to execute, if these resources are available, they will be granted and control returned to the user procedure. These resources are also thought of as devices. Some are physical, such as a video carte, and others are abstract, such as a file.

User programs asking the device, and when finished they release the device. Similar to files, we tin can read, write, and reposition the device.

ane.13.ii.4. Information Management¶

Some system calls exist purely for transferring information betwixt the user program and the operating system. An instance of this is fourth dimension, or engagement.

The OS also keeps data about all its processes and provides system calls to report this information.

1.13.2.5. Communication¶

At that place are two models of interprocess communication, the message-passing model and the shared memory model.

  • Message-passing uses a common mailbox to pass messages between processes.
  • Shared memory use certain system calls to create and gain access to create and proceeds access to regions of memory owned by other processes. The ii processes exchange information by reading and writing in the shared data.