0% found this document useful (0 votes)
25 views5 pages

System Calls

Uploaded by

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

System Calls

Uploaded by

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

System calls

Purpose:
System call provides an interface between a running program and
operating system. It allows user to access services provided by
operating system. This system calls are procedures written using C,
C++ and assembly language instructions. Each operating system has
its own name for each system call. Each system call is associated with
a number that identifies itself.

Types of System Calls:


1.Process Control
2.File management <= (dedicated qsn for examples)
3.Device Management
4.Information Maintenance
5.Communication
Explanation with examples:
1)Process Control:
• A running program can halt its execution either normally (end)
or abnormally (abort). If it detects an input error, it may
terminate abnormally and set an error level.
• A process running one program can load and execute another
program, allowing user-specified tasks to be carried out as
instructed by control cards. If a new process or job is created,
we should have control over its execution.
• It should also be possible to terminate a process or job if it is
incorrect or unnecessary, with the option to wait for it to finish
execution (wait time).
• System calls are also available for debugging programs
effectively.

Examples:
● Create/ Terminate process
● Load/Execute Process.
● End/Abort process.
● Ready process/Dispatch process.
● Suspend process/Resume Process.
● Get/Set Process Attributes.
● Wait event, signal event
● Allocate and deallocate memory
2) File Control:
• We can identify several common system calls dealing with files. We
first need to be able to create and delete files such a system call
requires the name of the file and perhaps some of its attributes.
• Once, the file is created, we need to open it and use it. We may also
read, write and reposition. Finally we need to close the file, indicating
that we are no longer using it.
Examples:
● create new file, delete existing file
● open, close file
● Create and delete directories
● read, write, reposition
● get/set file attributes
3) Device Management:
When a process is in running state, it requires several resources to
execute.
These resources include main memory, disk drives, files and so on. If
the resource is available, it is assigned to the process.
Once the resource is allocated to the process, process can read,
write and reposition the device.
Examples:
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• 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 operating system. 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 operating
system, the amount of free memory or disk space and so on.
• In addition the operating system keeps information about all of its
jobs and processes and there are system calls to access this
information. Generally, there are also calls to reset it. (get process
attributes and set process attributes).
Examples:
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.
5. Communication
• There are two models of inter-process communication, the
message-passing model and the shared memory model.
• Message-passing uses a common mailbox to pass messages
between processes
• Shared memory use certain system calls to create and gain access
to regions of memory owned by other processes
Examples:
• create, delete communication connection
• send, receive messages
• transfer status information
• attach or detach remote devices.

You might also like