0% found this document useful (0 votes)
2K views4 pages

System Call and Its Type

System calls provide an interface between processes and the operating system to request services. There are four main types of system calls: 1) process control for starting and stopping processes, 2) file management for reading/writing files, 3) device management for accessing devices, and 4) information maintenance for getting/setting system properties. System calls allow processes to perform privileged operations and communicate between each other.

Uploaded by

sanya garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views4 pages

System Call and Its Type

System calls provide an interface between processes and the operating system to request services. There are four main types of system calls: 1) process control for starting and stopping processes, 2) file management for reading/writing files, 3) device management for accessing devices, and 4) information maintenance for getting/setting system properties. System calls allow processes to perform privileged operations and communicate between each other.

Uploaded by

sanya garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

What is a system call?

Explain its 4 types

 System calls provide an interface between the process and the operating system.
 System calls allow user-level processes to request some services from the
operating system which process itself is not allowed to do.
 In handling the trap, the operating system will enter in the kernel mode, where it
has access to privileged instructions, and can perform the desired service on the
behalf of user-level process.
 Trap occur when the system call is made to terminate the currently running
program abnormally, or if the program runs into a problem and causes an error
trap, a dump of memory take place sometimes and error message is
generated.
 For I/O a process involves a system call telling the operating system to read or
write particular area and this request is satisfied by the operating system.

Types of System calls


 Process control

 File management

 Device management

 Information maintenance

 Communications

1) 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.
 Following are functions of process control:

i. end (normal termination), abort (abnormal termination)


ii. load, execute: When a process or job executing one program may want to
load and execute another program.(for example a user command, the click of a
mouse)
iii. create process, terminate process: When we create new job or process we
use create process call and when we want to terminate the created job or
process we use terminate process call.
iv. get process attributes, set process attributes: The ability to determine and
reset the attributes of a job or process, including the job’s priority, its maximum
allowance execution time etc..
v. wait for time: When we create new job or process we may need to wait for
them to finish their execution.
vi. wait event, signal event : We may want to wait for specific event to occur
(Wait event). The job or process should then signal when that event has
occurred (Signal event).
vii. allocate and free memory: In order to assign primary memory to the jobs and
process, allocate system call is used and to release that memory, free system
call is used.
2) File management :
 We first need to be able to create and delete files. Either system call requires the
name of the file and perhaps some of the file's attributes.
 Once the file is created, we need to open it and to use it. We may also read,
write, or reposition. Finally, we need to close the file, indicating that we are no
longer using it.
 We may need these same sets of operations for directories if we have a directory
structure for organizing files in the file system.
 In addition, for either files or directories, we need to be able to determine the
values of various attributes and perhaps to reset them if necessary. File
attributes include the file name, a file type, protection codes, and so on
Functions:
o create file, delete file

o open, close file

o read, write, reposition(rewind or skip to the end of the file)

o get and set file attributes

3) Device Management:
 A process may need several resources to execute - main memory, disk drives,
access to files, and so on. If the resources are available, they can be granted,
and control can be returned to the user process. Otherwise, the process will have
to wait until sufficient resources are available.
 The various resources controlled by the OS can be thought of as devices. Some
of these devices are physical devices (for example, tapes), while others can be
thought of as abstract or virtual devices (for example, files).
 Once the device has been requested (and allocated to us), we can read, write,
and (possibly) reposition the device, just as we can with files.
Functions:
o request device, release device

o read, write, reposition

o get device attributes, set device attributes

o logically attach or detach devices

4) Information Maintenance
 Many system calls exist simply for the purpose of transferring information
between the user program and the OS. For example, most systems have a
system call to return the current time and date.
 Other system calls may return information about the system, such as the number
of current users, the version number of the OS, the amount of free memory or
disk space, and so on.
 In addition, the OS keeps information about all its processes, and system calls
are used to access this information. Generally, calls are also used to reset the
process information.
Functions:
 get time or date, set time or date

 get system data, set system data

 get and set process, file, or device attributes

5) Communication
 There are two common models of interprocess communication: the message-
passing model and the shared-memory model. In the message-passing model,
the communicating processes exchange messages with one another to transfer
information.
 In the shared-memory model, processes use shared memory creates and shared
memory attaches system calls to create and gain access to regions of memory
owned by other processes.
 Recall that, normally, the OS tries to prevent one process from accessing
another process's memory. Shared memory requires that two or more processes
agree to remove this restriction. They can then exchange information by reading
and writing data in the shared areas.
 Message passing is useful for exchanging smaller amounts of data, because no
conflicts need be avoided. It is also easier to implement than is shared memory
for intercomputer communication.
 Shared memory allows maximum speed and convenience of communication,
since it can be done at memory speeds when it takes place within a computer.
Problems exist, however, in the areas of protection and synchronization between
the processes sharing memory.
Functions:
o create, delete communication connection

o send, receive messages

o transfer status information

o Attach and Detach remote devices

You might also like