Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

FUNCTIONS OF AN OPERATING

SYSTEM
1. Process Management
2. Memory Management
3. I/O Device management
4. File management
5. Network Management
6. System information protection.
7. Command Interpretation

PRay@CSE
Process Management
A process/task is an instance of a program in
execution.
A program is just a passive entity whereas a
process is an active entity. A process performs the
required functions of its related program.
Please note that a process /task is the smallest
unit of work that is independently schedulable.
To accomplish its task, a process needs certain
resources like CPU, memory, files and I/O devices.
These resources are allocated to the processes by
our OS only. PRay@CSE
OS has following functions related to the
process management:
a) Process creation
b) Process scheduling
c) Process suspending
d) Process resuming
e) Process synchronization
f) IPC
g) Process termination

PRay@CSE
Memory Management
Here, memory means the main memory (RAM).
For a program to get executed, it must be
mapped to absolute addresses and loaded into
memory.
So, efficient memory utilization is very
necessary here. This is done by our OS.
The principle storage management,
responsibilities are as follows:

PRay@CSE
1.Process isolation: It means the controlling of one
process that interacts with dates and memory of
other process.
2. Automatic allocation and Management: Memory
should be allocated dynamically based on the
priorities of the process, otherwise the process
waiting will increase which will decrease CPU and
memory utilization.
3. Support of modular programming: Instead of
loading, one big monolithic program, we can load
only some modules (if our program is modular).
This will increase CPU and memory utilization.
PRay@CSE
4. Protection and access control: Don't apply
protection techniques and access control to all
the processes. It is better to apply it to
important applications only. This will save the
execution time.
5.Long-term storage: Long-term storage of a
process will reduce the memory utilization. So,
swapping-in and swapping-out of the
processes is to be done.

PRay@CSE
I/O Device Management
As we know that an OS has a set of device driven i.e.
software routines that control respective I/O devices
through their controllers.
Device drivers are written for Keyboard, Mouse,
Monitor, Disk etc. and accordingly these are named as
keyboard device driver, mouse device driver and so on.
A device driver hides the peculiarities of its I/O device.
Also, we know that a device (I/O) communicates with a
host CPU through a connection point called as a port.
A controller is an electronic device that controls a port or
a bus or a device.

PRay@CSE
Any resource allocation and scheduling policy must
consider three factors:
(a) Fairness: Give equal priority to the demanding processes
at the time of resource scheduling
(b) Differential responsiveness: The OS takes the decisions
dynamically based on the classes of jobs and the
requirement of jobs.
(c) Efficiency: The main task of an OS is to minimize the
waiting time, minimize the response time and to
maximize the throughout.

PRay@CSE
File Management
Information may be stored on Floppies, CDs, Hard
disk, Tapes etc.
But for convenience, OS provides a uniform
logical view of the information storage.
This logical storage unit is known as a FILE.
The OS abstracts the logical unit 'File' from the
characteristics of the underlying media.

PRay@CSE
So, OS is responsible for:
(a) Creation/deletion of files.
(b) Creation deletion of directories.
(c) File and directory manipulation.
(d) Backing or storing files onto media like tapes.

PRay@CSE
Network Management

A distributed OS is an OS that runs on a network of


computers. The memory files are shared by the number
of users in the network from the server.
For example: If 20 nodes are connected by a server
through LAN then the OS, files, RAM, processor-slots are
all shared by 20 users, from the server.
Please note here that each user thinks that he is running
on a single large system with one OS. The users of a
distributed system need not know where their files are
on the network.

PRay@CSE
System Information Protection-Security
System protection refers to the mechanism for
controlling the access to computer resources by various
users and processes.
Since there will be many (multiple) users and hence,
multiple process being executed, so there is a need of
protection from each other and also protection of OS
from the user processes. This is the job of on OS.
Generally, three types of protection mechanisms are
there
(a) Access control
(b) Information flow control
(c) Certification
PRay@CSE
Access Control: It is our as only that provides
read, write or execution access permissions for
the files to the users. Without these permissions
one cannot access the files.
Information flow control : The OS regulates the
flow of data within the system. So, some
information should be restricted to the users
also.
Certification: The OS provides the priorities and
hierarchies to the resources. So, now we can
control unauthorized processes.

PRay@CSE
Command Interpretation
It is defined as an interface between the user
and the OS. When a new job is started in a batch
environment or when a user logs in a time-
shared system then the command interpreter is
automatically executed.
A command interpreter reads and interprets the
control statements. It is also known as a Shell.
There are two ways in which one can interact
with OS
1. By means of System Commands
2. By means of System Calls.
PRay@CSE
System Commands :
Users may interact with the OS directly by
using OS commands.
A command provides an interface between an
interactive user and the OS.
 For example, if you wish to list files or sub-
directories in MS-DOS then you invoke dir
command.

PRay@CSE
System Calls :
System calls provide an interface between the
processes and the OS.
User programs receives OS services through a set
of system calls only.
Please note that for each system command,
there will be an equivalent system call.
Also note that the system calls for an OS are
listed in the application programs Interface (API)
manual.

PRay@CSE
OPERATING SYSTEM STRUCTURE

PRay@CSE
 A system as large and complex, as a modern
OS must be engineered carefully if it has to
function properly. OS system structure may
be of 4 types:

PRay@CSE
Layered Structure Approach
The OS architecture based on a layered approach
consists of a number of layers/levels, each built on top of
lower layers.
The bottom layer is the hardware and the highest layer is
the user interface.
This was applicable by giving proper hardware support
so that the OS could be broken into smaller, more
appropriate pieces than those allowed by the original
MS-DOS or UNIX.
Hence, modular OS were created. The modularization of
the system can be done in many ways. The most normal
is a layered approach which consists of breaking up of
the OS in a number of Layers or Levels.
PRay@CSE
PRay@CSE
Problems/disadvantages of layered approach

1. The major problem with this approach is how


to differentiate one level from another.
Since a layer can use services of a layer below
it, it needs a careful planning.

PRay@CSE
2. The final problem with this approach is that they are
less efficient than other types. Please note that this is
because of the formation of chain of layers which delays
the whole process.
For example: For a user program to execute an I/O
operation, it executes a system call which is trapped to
the I/O layer, which calls the memory-management
layer, through the CPU scheduling layer and finally to
the hardware.
This results in chaining which is a long process and time
consuming.

PRay@CSE
Kernel approach
A Kernel is the control module of an operating
system (OS).
It is the one which loads first and remains in the
main memory. All critical routines are
implemented at this layer.
Since kernel stays in memory, therefore, it must
be kept as small as possible (i.e., highly
optimized).
The OS kernel comprises of I/O drivers, CPU
scheduler, pager, swapper etc. Kernel is that part
of an OS which directly interfaces with the
hardware. PRay@CSE
Some main functions of kernel are as follows:
I. It provides a mechanism for creation and
deletion of processes.
2. It provides processor scheduling, memory
management I/O management.
3. It provides mechanism for synchronization of
processes.
4. It provides mechanisms for inter-process
communications.

PRay@CSE
• The UNIX OS is based on the Kernel approach.
It is shown in Figure
PRay@CSE
As shown in Figure, there are two separable
parts: (a) Kernel (b) System programs.
Kernel lies between system programs (or
utilities) and hardware.
This Kernel uses system calls to perform all its
functions-like CPU scheduling, memory
management etc.
UNIX also supports many system calls. Please
remember that through these system calls, the
program utilizes the services of OS (Kernel).

PRay@CSE
Shell is an exclusive feature of UNIX. It has a
command Interpreter which receives and
executes OS commands.
For OS with GUI (Graphical User Interface)
facility, the command processor will interpret
mouse operations and executes the
appropriate command.
It is also known as a command line interpreter.

PRay@CSE
Virtual Machine Approach
It is an approach that creates an illusion of a real
machine. The virtual machine creates this illusion
by time-multiplexing the system resources
among all the users of the machine.
A user can also run a single-user OS on this
virtual machine. Different OS can run on different
virtual machines. For example, VM/370 on IBM
370.
An illusion is created by a virtual machine OS
that makes a single real machine to appear as
several real machines.
PRay@CSE
Advantages of virtual machine
1. It allows concurrent running of dissimilar OS by different user.
2. It eliminates certain conversion problem. (This is discussed
below).
3. Programs can be developed and debugged for machine
configurations that is different from those of host. For example: a
virtual OS-VM/370 can produce virtual 370 that are different form
the real 370 such as larger main memory.
4. The high degree of separation between independent virtual
machine provides more security and privacy. The most widely
used OS in this category is VM/370. It manages IBM/370
computer and creates an illusion that each of the several users
has a complete system 370 (including wide range of I/O devices)
which can run different OS at once, each of them on its own
virtual machine.
PRay@CSE

You might also like