0% found this document useful (0 votes)
14 views7 pages

System Call

A system call is a mechanism that allows programs to request services from the operating system's kernel, facilitating interaction with system resources. It encompasses various services such as process management, file handling, and device management, while ensuring protection and error handling. System calls require context switching to kernel mode, which can affect performance, and parameters are passed differently than in ordinary function calls.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views7 pages

System Call

A system call is a mechanism that allows programs to request services from the operating system's kernel, facilitating interaction with system resources. It encompasses various services such as process management, file handling, and device management, while ensuring protection and error handling. System calls require context switching to kernel mode, which can affect performance, and parameters are passed differently than in ordinary function calls.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

System call

Introduction of System Cal


A system call is a 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. A computer
program makes a system call when
it requests the operating system’s
kernel.
What is a System Call?
A system call is a mechanism used by programs
to request services from the operating system
(OS). In simpler terms, it is a way for a
program to interact with the underlying
system, such as accessing hardware resources
or performing privileged operations.
A user program can interact with the operating
system using a system call. A number of
services are requested by the program, and the
OS responds by launching a number of systems
calls to fulfill the request. A system call can be
written in high-level languages like C or Pascal
or in assembly language. If a high-level
language is used, the operating system may
directly invoke system calls, which are
Services Provided by System Calls
Process Creation and Management
Main Memory Management
File Access, Directory, and File System Management
Device Handling(I/O)
Protection
Networking, etc.
Process Control: end, abort, create, terminate, allocate,
and free memory.
File Management: create, open, close, delete, read
files,s, etc.
Device Management
Information Maintenance
Communication
Features of System Calls
Features of System
Calls
Interface: System calls provide a well-defined interface
between user programs and the operating system.
Programs make requests by calling specific functions, and
the operating system responds by executing the requested
service and returning a result.
Protection: System calls are used to access privileged
operations that are not available to normal user programs.
The operating system uses this privilege to protect the
system from malicious or unauthorized access.
Kernel Mode: When a system call is made, the program is
temporarily switched from user mode to kernel mode. In
kernel mode, the program has access to all system
resources, including hardware, memory, and other
processes.
Continue…
Context Switching: A system call requires a
context switch, which involves saving the state of the
current process and switching to the kernel mode to
execute the requested service. This can introduce
overhead, which can impact system performance.
Error Handling: System calls can return error codes to
indicate problems with the requested service. Programs
must check for these errors and handle them appropriately.
Synchronization: System calls can be used to synchronize
access to shared resources, such as files or network
connections. The operating system provides
synchronization mechanisms, such as locks or semaphores,
to ensure that multiple programs can access these
resources safely.
Methods to Pass Parameters to OS

If a system call occur, we have to pass parameter to


the Kernal part of the Operating system.
For example look at the given open() system call:
#include <fcntl.h> int open(const char *pathname,
int flags, mode_t mode);
Here pathname, flags and mode_t are the
parameters.
So it is to be noted that :
We can’t pass the parameters directly like in an
ordinary function call.
In Kernal mode there is a different way to perform a
function call.

You might also like