Advance Operating system SHESNA.T MSC(IT) MS(Computer Science) Dept.of Computer Science
Content System Call
API
How System Call Works? Why do you need System Calls in OS? Types
The kernel is a computer program at the core of a computer 's operating system and generally has complete control over everything in the system. The kernel is also responsible for preventing and mitigating conflicts between different processes. It is the portion of the operating system code that is always resident in memory and facilitates interactions between hardware and software components.
System Call System Call provides an Interface between user program & Operating system.system call will act as an interface between software applications and kernel. Kernel is the interface between applications and operating system. In computing, a system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. A system call is a way for programs to interact with the operating system.
API Application Program Interface(API) provides an interface between a process and operating system to allow user-level processes to request services of the operating system. System calls are the only entry points into the kernel system. All programs needing resources must use system calls. System call provides the services of OS to the process via API. when the process is being executed and if it requires any resource the process will create a system call (interupt) and sends to the kernel.
memory is divided into two space kernel space user space System call is will be created in the user space System call is will be executed in the kernel space Resource will be provided by the kernel. In the kernel mode system call table will be maintained In the system call table address of each and every system call will be maintained Based up on the priority one by one system call will be retreieved from the table and executed.
How System Call Works? Step 1) The processes executed in the user mode till the time a system call interrupts it.
Step 2) After that, the system call is executed in the kernel-mode on a priority basis.
Step 3) Once system call execution is over, control returns to the user mode.,
Step 4) The execution of user processes resumed in Kernel mode.
Why do you need System Calls in OS? Reading and writing from files demand system calls.
If a file system wants to create or delete files, system calls are required.
System calls are used for the creation and management of new processes.
Network connections need system calls for sending and receiving packets.
Access to hardware devices like scanner, printer, need a system call.
Types Process Control
File Management
Device Management
Information Maintenance
Communications
Categories of System Calls System calls can be grouped into five major categories as follows. Process control File management. Device management Information Maintenance and Communication.
Process control Some system calls under process control are: Responsible for process management creating, terminating. End, abort Load, execute Create process, terminate process Get process, terminate process Wait for time Allocate and free memory
File management. Some system calls under file management are: Create file, delete file Open , close Read, write, reposition. Get file attributes, set fil attributes
Device management Some system calls under device management are: Request Device, release device Read, write, reposition. Get device attributes and set device attributes Logically attach or detach devices
Information Maintenance Responsible for information being shared between processes,os. Some system calls under information maintenance are: Get time or date, Set time of date Logically attach or detach devices Information maintenance Get system data, Set Systems data Get process, file of device attributes Set process, file or device attributes
Communication Responsible for inter process communications. Create, delete communication connection. Send, receive messages Transfer status information Attach or detach remote devices.