2
1.9kviews
What is system call? Explain any five system calls.
1 Answer
2
65views

Solution

System call

  • The interface between the operating system and the user programs is defined by the set of system calls that the operating system provides.

  • The system calls available in the interface vary from operating system to operating system.

  • Any single-CPU computer can execute only one instruction at a time.

  • If a process is running a user program in user mode and needs a system service, such as reading data from a file, it has to execute a trap or system call instruction to transfer control to the operating system.

  • The operating system then figures out what the calling process wants by inspecting the parameters.

  • Then it carries out the system call and returns control to the instruction following the system call.

- There are 5 different categories of system calls:

  • process control

  • file manipulation

  • device manipulation

  • information maintenance

  • communication.


  • Process control: A running program needs to be able to stop execution either normally or abnormally. When execution is stopped abnormally, often a dump of memory is taken and can be examined with a debugger

  • file manipulation: Some common system calls are create, delete, read, write, reposition, or close. Also, there is a need to determine the file attributes – get and set file attribute. Many times the OS provides an API to make these system calls.

  • Device manipulation:Process usually require several resources to execute, if these resources are available, they will be granted and control returned to the user process. These resources are also thought of as devices. Some are physical, such as a video card, and others are abstract, such as a file.

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

  • Information maintenance: Some system calls exist purely for transferring information between the user program and the operating system. An example of this is time, or date.

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

  • Communication: There are two models of interprocess communication, the message-passing model and the shared memory model

Please log in to add an answer.