Breaking News

System programs and calls in Operating System

SYSTEM CALLS

System provides an interface between the operating system and the process. The calls are generally available as low-level language i.e. assembly language instruction and certain system allow system call to be made directly from a high-level language program. 
when a program in user mode requires access to the hardware it must ask to the kernel to give privilege to that resource and this can be done via a system call.

A system call instruction generates an interrupt and allows OS to gain control of the program.
System calls occur in different ways depending upon the computer.

Types of System Calls

System calls may be grouped roughly into 5 categories:
  1. Process Control
  2. file Management
  3. Device Management
  4. Information Maintenance
  5. Communication 
Passing Parameters to OS



3 General Methods are used to pass the parameter to OS-
  • Simplest Approach-  Pass the parameters in registers. There can be more parameters than register in these case the parameter is generally in a block or table in memory and the address of the block is passed as a parameter in a register. this approach used by Linux OS.

  • By using the Stack- parameter can be placed or pushed onto the stack by the program and popped off the stack by OS.
  • Combination- some Os prefer the block or stack methods because those approaches do not limit the number or length of the parameter being passed.


SYSTEM PROGRAM

Many system calls are used to transfer information between a user program and an OS. example- Most Systems have the system calls to return the current time & date, number of the current users, amount of free memory or disk space and so on.
In addition, the OS keeps information about all its processes and there are system calls to access this information.

No comments