0% found this document useful (0 votes)
5 views

system call

System calls serve as the interface between user programs and the operating system, allowing applications to request services through a high-level API. There are five main types of system calls: process control, file management, device management, information maintenance, and communication. The document also discusses the structure of operating systems, highlighting the client-server model and the role of system programs.

Uploaded by

Surya Basnet
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

system call

System calls serve as the interface between user programs and the operating system, allowing applications to request services through a high-level API. There are five main types of system calls: process control, file management, device management, information maintenance, and communication. The document also discusses the structure of operating systems, highlighting the client-server model and the role of system programs.

Uploaded by

Surya Basnet
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 21

System Call

System Call

• Interfaces between user programs and the operating


system
• Requesting services and functionalities from the OS
• Programming interface to the services provided by the OS
• Typically written in a high-level language (C or C++)
• Mostly accessed by programs via a high-level Application
Programming Interface (API) rather than direct system call use
• Three most common APIs are Win32 API for Windows, POSIX API for
POSIX-based systems (including virtually all versions of UNIX, Linux,
and Mac OS X), and Java API for the Java virtual machine (JVM)
Introduction
• System calls: The mechanism used by an
application program to request service from the
operating system. System calls often use a special
machine code instruction which causes the
processor to change mode (e.g. to "supervisor
mode" or "protected mode"). This allows the OS to
perform restricted actions such as accessing
hardware devices or the memory management
unit.
System call sequence to copy the contents of one file to another file
There are five types of System
Calls:

• process Control
• File Management
• Device Management
• Information Maintenance and
• Communication

• https://mycareerwise.com/content/system-c
alls/content/exam/gate/computer-science
Process Control
• End, abort
• Load, execute
• Create Process, Terminate Process
• Get process, terminate process
• Wait for time
• Allocate and free memory

• Fork: creating new Process


• Exec: Replacing the current process
• Wait: suspending process execution
• Exit: Terminating the current process
File Management
• System Calls for File Management
• Open: Opening files for reading , writing or both
• Read: Reading data from files into buffers
• Write: Writing data from buffers to files
• Close: closing file description and releasing resources
Device Management
• System Calls for Directory Management
• Mkdir: Creating new directories
• Rmdir: Removing empty directories
• Opendir: Opening directories for reading
• Readdir: Reading directory contents
Information maintenance

• Get time or date, set time or date


• Logically attach or detach devices
• Information maintenance
• Get system data, set system data
• Get process, file of device attributes
• Set Process, file or device attributes
Communication

• Create, delete communication , connection


• Send , receive messages
• Transfer status information
• Attach or detach remote devices.
System Calls
System Programs

• Shell: Command-line interface for user-OS interaction


• Compiler: Translating high-level languages into
machine code
• Text Editor: Creating, editing, and manipulating text
files
• Debugger: Identifying and fixing software issues
Steps in Making a System Call

There are 11 steps in making the system call


read (fd, buffer, nbytes)
Operating systems

• The OS may be split into a kernel which is always present and various
system programs which use facilities provided by the kernel to
perform higher-level house-keeping tasks, often acting as servers in a
client-server relationship.
Operating System Structure

The client-server model


Operating System Structure

The client-server model in a distributed system


Summary

• We studied the importance of system calls.


• And the structure of modern operating systems: client/server and
distributed.

You might also like