0% found this document useful (0 votes)
10 views6 pages

Os Seminar Report

Uploaded by

Umema Fathima
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)
10 views6 pages

Os Seminar Report

Uploaded by

Umema Fathima
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/ 6

SHADAN WOMENS COLLEGE OF ENGINEERING AND

TECHNOLOGY
( an autonomous institute affiliated to JNTU-H)

OS LAB SEMINAR REPORT


NAME : UMEMA FATHIMA

HT.NO : 23L51A6610

BRANCH : AIML

SUBJECT : OPERATING SYSTEM


1. Introduction

The operating system (OS) is a crucial part of any computer system, responsible for managing
hardware and software resources, providing a platform for executing applications, and ensuring
efficient use of resources. One of the fundamental concepts within an OS is the interaction
between user applications and the hardware, which is achieved through system calls.

System calls provide the interface through which programs can request services from the kernel,
which is the core of the operating system. These requests can range from simple tasks like
input/output (I/O) operations to more complex tasks like process management and memory
allocation. Understanding how system calls are executed and their interaction with the kernel is
essential for anyone involved in OS design, system programming, or software development.

In this report, we will explore the system call mechanism and the role of kernel architecture in
processing these calls. The report will outline how system calls are invoked, their interaction
with the kernel, and how they contribute to the functionality of modern operating systems.
2. System Calls: Definition and Types

2.1 What is a System Call?

A system call is a request made by a user-level program (application) to the kernel of the
operating system for a specific service. These services typically involve interactions with
hardware, file systems, or processes. System calls are essential for the functioning of an
operating system, as they serve as a bridge between user applications and low-level OS services.

System calls are executed in privileged mode (also known as kernel mode) to prevent user
programs from directly accessing or modifying critical system resources.

2.2 Types of System Calls

System calls can be categorized into several types based on their functionality:

1. Process Control:
o Create and terminate processes (e.g., fork(), exec()).
o Process synchronization and scheduling (e.g., wait(), sleep()).

2. File Management:
o Operations related to files and directories (e.g., open(), read(), write(), close()).

3. Device Management:
o Interaction with hardware devices (e.g., ioctl(), read(), write()).

4. Information Maintenance:
o Managing system information (e.g., getpid(), setpriority()).

5. Communication:
o Inter-process communication (e.g., pipe(), mmap()).
3. Kernel Architecture and System Calls

The kernel is the central component of an operating system that manages the system's resources,
including the CPU, memory, and I/O devices. It operates in kernel mode and has full access to
the hardware. User programs, on the other hand, execute in user mode and have restricted access
to system resources.

When a system call is invoked, the program transitions from user mode to kernel mode, where
the operating system performs the requested action. This context switch between user mode and
kernel mode is one of the key features of system calls.

3.1 How System Calls Work

The execution flow of a system call involves several key steps:

1. Invocation from User Mode:


o A program invokes a system call by using a wrapper function, typically a library function,
which prepares the parameters for the system call.

2. Context Switch:
o The CPU switches from user mode to kernel mode. This involves saving the state of the
user program and loading the state of the kernel, ensuring that the kernel can safely
perform the requested operation.

3. System Call Handling:


o The kernel receives the system call request, validates it, and performs the appropriate
action (e.g., reading a file, creating a process). The kernel often uses a system call table
to map system call numbers to corresponding handler functions.

4. Return to User Mode:


o Once the system call is executed, the kernel prepares a return value and switches the
CPU back to user mode, where the program resumes execution.

3.2 Kernel Architecture:

The kernel is structured in different layers, each responsible for specific tasks related to system
resource management. Key layers that interact with system calls include:

1. System Call Interface (SCI):


o This is the primary interface through which applications communicate with the kernel. It
processes system call numbers, validates arguments, and dispatches the call to the
appropriate kernel function.

2. System Call Table:


o The system call table is a mapping of system call numbers to their corresponding
handler functions. Each system call has a unique number, and the kernel uses this
number to locate and execute the relevant function.

3. Kernel Services:
o These include process management, memory management, file systems, and device
drivers. These services handle the actual implementation of system calls.

4. Interrupt Handling:
o System calls often involve hardware interrupts (e.g., when performing I/O operations).
The kernel is responsible for managing these interrupts and ensuring that system calls
are executed efficiently.

4. System Call Process in Linux

In Linux, system calls are implemented in a specific manner that involves interaction between
the user space and kernel space. Below is an example of how a system call is executed in Linux:

1. User Space:
o A user-level program requests a system call, such as read(), which is provided by the C
library (glibc).

2. System Call Invocation:


o The glibc wrapper invokes the system call using a special assembly instruction
(syscall) that triggers the kernel mode.

3. Kernel Space:
o The kernel receives the call and uses the system call table to identify the corresponding
kernel function (in this case, sys_read()).

4. Execution:
o The kernel executes the appropriate function and performs the requested task (e.g.,
reading data from a file).

5. Return to User Space:


o Once the operation is completed, the kernel returns control to the user program, along
with the result of the system call.
5. Performance Considerations in System Calls

System calls can incur overhead due to the context switch between user mode and kernel mode.
This overhead can affect the performance of an application, especially in systems with frequent
system call invocations.

To minimize overhead, operating systems employ several optimization techniques:

 Direct System Call Interface (DSCI):


o In some cases, operating systems allow direct access to certain kernel functions without
the need for a full context switch, reducing the overhead of system calls.

 Efficient System Call Handling:


o Optimizing the system call dispatcher and reducing unnecessary checks or memory
copies can improve system call performance.

 Batching System Calls:


o Some systems allow grouping multiple system calls into a single call, reducing the
overhead associated with multiple context switches.

6. Conclusion

System calls are a crucial component of modern operating systems, providing the interface for
user applications to access kernel services. Understanding the kernel architecture and the
mechanics of system calls is essential for developing efficient software and managing system
resources effectively. The interaction between user space and kernel space ensures that critical
system functions, such as process management, memory allocation, and I/O operations, are
executed securely and efficiently.

By optimizing system call handling and minimizing performance overhead, operating systems
can achieve higher performance and responsiveness, ultimately enhancing the user experience.

7. References

1. Tanenbaum, A. S., & Bos, H. (2015). Modern Operating Systems (4th ed.). Pearson.
2. Love, R. (2010). Linux Kernel Development (3rd ed.). Addison-Wesley.
3. O'Reilly, T. (2000). Unix System Programming. O'Reilly Media.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy