Operating System and its Functions
An operating system is a program that acts as an intermediate part between a user of a computer
and the computer hardware and controls the execution of all kinds of programs.An operating
system is the program that, after being initially loaded into the computer by a boot program,
manages all the other programs in a computer.
Objectives of OS:
1.Convenience: An OS makes a computer more convenient to use.
2.Efficiency: An OS allows the computer system resources to be used in an efficient manner.
3.Ability to evolve: An OS should be constructed in such a way as to permit the effective
development, testing, and introduction of new system functions without interfering with service.
Functions of an operating System are as follows:
Memory Management:
Memory management refers to management of Primary Memory or Main Memory.An Operating
System does the following activities for memory management: OS Keeps tracks of primary
memory, i.e., what part of it are in use by whom, what part are not in use.In multi-programming,
the OS decides which process will get memory when and how much.OS allocates the memory
when a process requests it to do so. It de-allocates the memory when a process no longer needs it
or has been terminated.
Processor Management:
In multi-programming environment, the OS decides which process gets the processor when and
for how much time. This function is called process scheduling. An Operating System does the
following activities for processor management: OS keeps tracks of processor and status of
process.OS allocates the processor (CPU) to a process.It de-allocates processor when a process
is no longer required.
Device Management:
,An Operating System manages device communication via their respective drivers. It does the
following activities for device management: Keeps tracks of all devices. The program responsible
for this task is known as the I/O controller. Decides which process gets the device when and for
how much time. OS allocates the device in the most efficient way.It de-allocates devices in most
efficient way.
File Management:
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions.An Operating System does the following
activities for file management: Keeps track of information, location, uses, status etc. The
collective facilities are often known as file system. OS Decides who gets the resources.It allocates
the resources and also de-allocates the resources when not in need.
Security:
OS prevents unauthorized access to programs and data.For shared or public systems, the OS
controls access to the system as a whole and to specific system resources.
Control over system performance:
OS will collect usage statistics for various resources and monitor performance parameters such
as response time,Recording delays between request for a service and response from the system.
Job accounting:
OS Keeps track of time and resources used by various jobs and users.On any system, this
information is useful in anticipating the need for future enhancements and in tuning the system
to improve performance and can be used for job accounting purposes.
Error detection & Response:
A variety of errors can occur while a computer system is running. These include internal and
external hardware errors, such as a memory error, or a device failure or malfunction; and various
software errors.In each case, the OS must provide a response that clears the error condition with
the least impact on running applications. The response may range from ending the program that
caused the error, to retrying the operation, to simply reporting the error to the
application,Production of dumps, traces, error messages, and other debugging and error detecting
aids.
,Booting the computer:
Booting is the process of starting or restarting the computer. If computer is switched off
completely and then turned on then it is cold booting.If computer is restarted then it is warm
booting.Booting of the computer is done by OS.
Coordination between other software and users:
An OS enables coordination of hardware components, coordination and assignment of compilers,
interpreters, assemblers and other software to the various users of the computer systems.
Structures of Operating System
Layered Structure:
The operating system is split into various layers In the layered operating system and each of the
layers have different functionalities. This type of operating system was created as an improvement
over the early monolithic systems.
Layering provides a distinct advantage in an operating system. All the layers can be defined
separately and interact with each other as required. Also, it is easier to create, maintain and update
the system if it is done in the form of layers. Change in one layer specification does not affect the
rest of the layers.
Each of the layers in the operating system can only interact with the layers that are above and
below it. The lowest layer handles the hardware and the uppermost layer deals with the user
applications
.
Layers in Layered Operating System
There are six layers in the layered operating system. A diagram demonstrating these layers is as
follows:
, Details about the six layers are:
Hardware
This layer interacts with the system hardware and coordinates with all the peripheral devices used
such as printer, mouse, keyboard, scanner etc. The hardware layer is the lowest layer in the
layered operating system architecture.
CPU Scheduling
This layer deals with scheduling the processes for the CPU. There are many scheduling queues
that are used to handle processes. When the processes enter the system, they are put into the job
queue. The processes that are ready to execute in the main memory are kept in the ready queue.
Memory Management
Memory management deals with memory and the moving of processes from disk to primary
memory for execution and back again. This is handled by the third layer of the operating system.
Process Management
This layer is responsible for managing the processes i.e assigning the processor to a process at a
time. This is known as process scheduling. The different algorithms used for process scheduling
are FCFS (first come first served), SJF (shortest job first), priority scheduling, round-robin
scheduling etc.
I/O Buffer