Os Seminar Report
Os Seminar Report
TECHNOLOGY
( an autonomous institute affiliated to JNTU-H)
HT.NO : 23L51A6610
BRANCH : AIML
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
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.
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.
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.
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:
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.
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).
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).
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.
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.