System Call
System Call
1. The first input the program needs is the name of the two files: the input file
and the output file. The inputting file name requires many I/O system calls.
2. Then, the program must open the input file and create the output file. When it
tries to open the input file, it may find that there is no file of that name or that
the file is protected against access. In such cases, the program must print an
error message on the console(another sequence of system calls).
3. When there is already an output file with the same name, the program may
abort(a system call), or delete the existing file(another system call) and
create a new one(create system call).
4. Then the program enters into a loop that reads the input file(a system call)
and writes to the output file(another system call).
5. After the entire file is copied, the program may close both the file(another system
call).
Process Control : Process control system calls are used to manage processes,
such as creating, terminating, and executing them. They are used in operating
systems to allow applications to run smoothly without interfering with each other.
Functions of process control :
i) End and Abort
ii) Loading and execution of process
iii) Creation and termination of a process
iv) Wait and signal event
v) Allocation of free memory
File Management: used to handle the files
Functions of file management:
i) Creation of files
ii)Deletion of files
iii)Opening & closing of a file
iv)Reading, writing, and reposition
v) Getting and setting file attributes.
Device Management system call deals with devices (reading from device
buffer or writing into device buffers : A process may need several resources to
execute—main memory, disk drives, access to files, and so on. If the resources are
available, they can be granted, and control can be returned to the user process.
Otherwise, the process will have to wait until sufficient resources are available.
Some of these devices are physical devices (for example, tapes), while others can
be thought of as abstract or virtual devices (for example, files)
Functions of device management
i) Requesting & releasing devices
ii) Attaching & detaching devices logically
iii) Getting & setting device attributes
Information Maintenance: Many system calls exist simply for the purpose of
transferring information between the user program and the operating system.
For example, most systems have a system call to return the current time and
date. Other system calls may return information about the system, such as the
number of current users, the version number of the operating system, the amount
of free memory or disk space, and so on.
In addition, the operating system keeps information about all its processes, and
system
calls are used to access this information.
Generally, calls are also used to reset the process information (get process
attributes and set process attributes) .
Communication: used for inter process communication
Function of IPC
Creation & deletion of communication connections
Sending & receiving messages
Helping OS transfer status information
Attaching or detaching remote devices
Protection:
Provides a mechanism for controlling access to the resources provided by a
computer system.
Function of Protection:
i. Protection including the permission & getting the permission.
ii. Manipulating the permission settings of resources such as files and disks
iii. Whether particular users can or cannot be allowed access to certain
resources
Simple Structure
A Simple Structure OS has a minimal organization, often lacking clear modularization. The
entire system is loosely divided into layers, but the separation is not strict.
Example OS:
MS-DOS
Early UNIX
Advantages:
Disadvantages:
2. Monolithic Structure
A Monolithic Structure OS has all its components (e.g., file system, memory management,
I/O, etc.) compiled into a single large kernel, running in kernel mode.
Example OS:
Linux
UNIX
Advantages:
✅ Fast execution – System calls and kernel operations are handled efficiently within the
same memory space.
✅ Direct hardware access – Leads to better performance.
✅ Simpler design compared to microkernels – Since everything is in one kernel,
interactions between OS components are fast and direct.
Disadvantages:
In a layered OS, the system is divided into multiple layers, each performing specific
functions. The lower layers interact directly with hardware, while higher layers provide user-
level services.
Example OS:
Advantages:
Disadvantages:
2. Microkernel Structure
A microkernel OS keeps only the essential core functions (like memory management,
process scheduling, and IPC) in the kernel. Other services (such as device drivers and file
systems) run in user space.
Example OS:
MINIX
QNX
Advantages:
Disadvantages:
3. Modular Structure
A modular OS is designed like a monolithic OS but with the ability to load and unload
kernel modules dynamically.
Example OS:
Advantages:
Disadvantages:
❌ Complex implementation – Managing dynamic module loading requires careful design.
❌ Security risks – Vulnerabilities can be introduced if modules are not properly verified.
❌ Potential instability – If a module crashes, it can affect the entire system.