System Call in OS Assignment 2
System Call in OS Assignment 2
Assignment: 2
Submitted to:
Madam Mehak
Submitted by:
Hamna Awan
Registration NO:
BCS07193114
Class:
(BScs) 4th
Departm
ent of
computer science
University of Lahore
System Call in OS: Types and Examples
System call offers the services of the operating system to the user programs
via API (Application Programming Interface). System calls are the only entry
points for the kernel system.
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.,
Process Control
File Management
Device Management
Information Maintenance
Communications
Process Control
This system calls perform the task of process creation, process termination,
etc.
Functions:
File Management
File management system calls handle file manipulation jobs like creating a file,
reading, and writing, etc.
Functions:
Create a file
Delete file
Open and close file
Read, write, and reposition
Get and set file attributes
Device Management
Device management does the job of device manipulation like reading from
device buffers, writing into device buffers, etc.
Functions
Information Maintenance
It handles information and its transfer between the OS and the user program.
Functions:
Communication:
These types of system calls are specially used for interprocess
communications.
Functions:
fork()
Processes use this system call to create processes that are a copy of
themselves. With the help of this system Call parent process creates a child
process, and the execution of the parent process will be suspended till the
child process executes.
exec()
This system call runs when an executable file in the context of an already
running process that replaces the older executable file. However, the original
process identifier remains as a new process is not built, but stack, data, head,
data, etc. are replaced by the new process.
kill():
The kill() system call is used by OS to send a termination signal to a process
that urges the process to exit. However, a kill system call does not necessarily
mean killing the process and can have various meanings.
exit():
The exit() system call is used to terminate program execution. Specially in the
multi-threaded environment, this call defines that the thread execution is
complete. The OS reclaims resources that were used by the process after the
use of exit() system call.