FOR FREE MATERIALS

Systems Calls:

 

A system call is a function by which a user’s program requests a service from the kernel of OS to execute the program. Kernel permanently resides in memory, is the part of the operating system that implements the “system calls”. 

 

So, a system call is a request made by the user program in order to get any kind of services from OS through the kernel, and for different kinds of services, there is a different kind of system call. A system call is invoked in a variety of ways, depending on the functionality provided by the underlying processor. In all forms, it is the method used by a process to request action by the operating system. 

 

When a system call is executed, it is typically treated by the hardware as a software interrupt. Control passes through the interrupt vector to a service routine in the operating system, and the mode bit is set to kernel mode i.e. the mode is switched from user mode to kernel mode. 

 

The system-call service routine is a part of the operating system. The kernel examines the interrupting instruction to determine what system call has occurred; a parameter indicates what type of service the user program is requesting. Additional information needed for the request may be passed in registers, on the stack, or in memory (with pointers to the memory locations passed in registers). The kernel verifies that the parameters are correct and legal, executes the request, and returns control to the instruction following the system call.

 

System call is used to access operating system functionality. System calls usually invoked by software interrupt.

 

Services by Systems calls:

A. Creating, opening, closing, and deleting files.

B. New process creation and management.

C. Main memory management.

D. Requesting access to hardware devices and OS services.

E. Security and Protection.

F. Manages networking.

 

Types of System Calls:

 

• Process control

  • a) end, abort
  • b) load, execute
  • c) create process, terminate process
  • d) get process attributes, set process attributes
  • e) wait for time
  • f) wait event, signal event
  • g) allocate and free memory

 

• File management

  • a) create file, delete file
  • b) open, close
  • c) read, write, reposition
  • d) get file attributes, set file attributes

 

• Device management

  • a) request device, release device
  • b) read, write, reposition
  • c) get device attributes, set device attributes
  • d) logically attach or detach devices

 

• Information maintenance

  • a) get time or date, set time or date
  • b) get system data, set system data
  • c) get process, file, or device attributes
  • d) set process, file, or device attributes

 

• Communications

  • a) create, delete communication connection
  • b) send, receive messages
  • c) transfer status information
  • d) attach or detach remote devices
  •  
Fig 6: Systems Calls

 

Fig 7: Write systems calls