2082 4

BIT204 ยท 2082 ยท 5 marks

Define system call? What are its objectives?

Define system call? What are its objectives? [5]

Operating SystemsChapter 2: Operating System StructuresSystem call definition and objectives

Quick answer

A system call is a programmatic way in which a computer program requests a service from the kernel of the operating system. It provides an interface between a user-level process and the operating system, allowing user programs to request OS services that require higher privilege levels (kernel mode) than the user mode in which normal programs run.

System Call: Definition and Objectives

Definition

In simple terms, a system call is a controlled entry point into the kernel through which a running program can ask the OS to perform operations on its behalf.

Example: When a program wants to read a file, it issues a read() system call rather than directly accessing the hardware.


Objectives of System Calls

System calls serve the following key objectives:

1. Hardware Abstraction

System calls hide the complexity of hardware from user programs. Programmers do not need to know the details of hardware devices; they simply call standard system call interfaces.

2. Protection and Security

They ensure that user programs cannot directly access hardware or critical OS resources. The OS validates each request, preventing unauthorized or harmful operations.

3. Resource Management

System calls allow the OS to manage and allocate resources (CPU, memory, I/O devices, files) in a controlled and fair manner among multiple processes.

4. Mode Switching (User Mode to Kernel Mode)

System calls provide a safe and controlled mechanism to switch from user mode to kernel mode, so that privileged instructions can be executed only under OS supervision.

5. Process Control

They allow user programs to create, terminate, and manage processes and threads (e.g., fork(), exec(), exit()).

6. Inter-Process Communication (IPC)

System calls provide mechanisms for processes to communicate and synchronize with each other (e.g., pipes, message queues, shared memory).

7. File and I/O Operations

They provide a standard interface for file management and input/output operations such as open(), read(), write(), and close().


Summary Table

ObjectiveExample System Call
Process Controlfork(), exit(), wait()
File Managementopen(), read(), write()
Device Managementioctl(), read(), write()
Information Maintenancegetpid(), alarm()
Communication (IPC)pipe(), shmget()

In conclusion, system calls act as the bridge between user applications and the operating system kernel, ensuring security, abstraction, and controlled access to system resources.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.