Operating system System Calls as pptx on slide share

ggrakesh2255 0 views 22 slides Oct 09, 2025
Slide 1
Slide 1 of 22
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

Operating system System Calls


Slide Content

OPERATING SYSTEM SYSTEM CALLS

What are system calls in Operating System ? The interface between a process and an operating system is provided by system calls. In general, system calls are available as assembly language instructions . They are also included in the manuals used by the assembly level programmers. System calls are usually made when a process in user mode requires access to a resource. Then it requests the kernel to provide the resource via a system call.

System Calls – Real Life Example Imagine you’re in a restaurant. You can’t go into the kitchen and make your own food. Instead, you call the waiter and tell them what you want. The waiter then goes to the kitchen, gets it, and serves you. Restaurant Example In the same way: You (the customer) A user program The waiter The system call The kitchen The operating system Food The service or result

This is a privileged mode that allows programs to directly access memory and other hardware resources. 1. Kernel Mode 2. User Mode In this mo de, programs cannot directly access memory or hardware resources; they must request access through system calls. A computer operatesin two modes:

Introducation to System Calls A system call is a programmatic method through which a user-level program requests a service from the kernel of the operating system. It provides a secure interface for interacting with OS functions such as file management, device control, and process handling. System calls are triggered via high-level APIs, allowing applications written in languages like C or Pascal to switch into kernel mode to perform tasks. They are the only controlled access points into the OS kernel, offering a standardized and safe way for programs to use system resources.

Introduction to System Calls

Why Do You Need System Calls in OS ? File Operations: Rea ding, writing, creating, or deleting files require system calls. Process Management: Creating and managing processes is done through system calls. Network Communication: Sending and receiving data over a network requires system calls. Device Access: Accessing hardware devices (printers, disks, etc.) needs system calls.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ante nulla, gravida vitae ultricies sed, tempus nec magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ante nulla, gravida vitae ultricies sed, tempus nec magna. 1.Process Control Process Control These system calls handle tasks related to process management, including creating new processes, running them, pausing or resuming execution, and properly ending them. They also manage communication between processes and allocate the necessary system resources. Functions & Examples: End and Abort – Stop a process either normally or due to an error. Example: Closing a running app manually or when it crashes. Load and Execute – Load a program into memory and run it. Example: Opening Microsoft Word from the desktop.

Functions & Examples: Create Process an d Terminate Process – Start a new process or end an existing one. Example: Starting a music player app or closing a browser tab. Wait and Signal Event – Pause a process until a specific event occurs, or signal that the event has happened. Example: A printer app waiting until the print queue is clear before starting the next print job. Allocate and Free Memory – Request memory for a process or release unused memory. Example: A game allocating extra memory for high graphics and releasing it when you quit.

File Management System calls that help us work with files — creating, opening, reading, writing, and deleting. Functions & Examples: Create a File – Make a new file to store data. Example: Making a Word file called Notes.docx. Delete File – Remove files you don’t need anymore. Example: Deleting an old photo from your phone 2.File Management

Open and Close File – Open a file to use it, then close it after work. Example: Opening a PDF to read and closing it. Read, Write, and Reposition – Read data, add new data, or jump to a certain part of the file. Example: Reading a saved game, saving progress, or skipping to a chapter in an eBook. Functions & Examples:

3.Device Management Device Management These system calls are used to control and interact with hardware devices like keyboards, printers, and storage drives. Functions & Examples: Request and Release Device Example: Opening and closing a printer device for printing. Linux system calls: open(), close() Logically Attach/Detach Devices Example: Mounting and unmounting an external hard drive. Linux commands: mount, umount Get and Set Device Attributes Example: Changing terminal settings or display resolution. Linux system calls : ioctl() (input/output control)

Real OS Examples in Linux: open() – Open device/file for use close() – Close device/file after use read() – Read data from a device write() – Write data to a device ioctl() – Control device settings (e.g., change terminal mode )

4.Information Maintenance Information maintenance Handles information and its transfer between the OS and the user program. Allows retrieving or updating system data.

5.Communication Communication: Manage communication between processes. Functions & Examples: Create Connection – Establish communication between processes. Example: Opening a socket for chatting apps. Linux command: socket(), connect() Delete Connection – Close the communication link. Example: Ending a video call session. Linux command: close()

Sen d Message – Transmit data to another process. Example: Sending a print job to the printer service. Linux command: send(), write() Receive Message – Accept data from another process. Example: Getting a notification from a background app. Linux command: recv(), read() Transfer Status – Help OS monitor communication states. Example: Checking if message queue is full. Linux commands: ipcs, ipcrm Functions & Examples:

How does System Call Work ? Request Made: A user-level program calls a library function like read() or write() to request a system-level task. Mode Switch: The CPU switches from user mode to kernel mode using a special instruction (like syscall). Kernel Handles Task: The OS validates and performs the requested operation (e.g., file I/O, process creation). Return to User Mode : The system call returns the result to the user program, and CPU switches back to user mode.

1 Advantages of System Calls Abstraction: Hides low-level hardware details from the user. Security: Ensures controlled access to critical system resources. Efficiency: Allows direct interaction with the OS for resource management. Process Control: Enables creation, execution, and termination of processes. Device Management: Provides standardized way to communicate with hardware. File Handling: Allows reading, writing, opening, and closing files efficiently. Communication: Facilitates data exchange between processes.

Disadvantages of System Calls Step 1 Complexity: Programming with system calls requires deep OS knowledge. Security Risks: Improper use can lead to vulnerabilities or system crashes. Portability Issues: System calls are OS-specific and may not work across platforms. Debugging Difficulty: Errors in system call usage can be hard to trace and fix. Performance Overhead: Frequent system calls may slow down program execution due to mode switching.

Thank You
Tags