0% found this document useful (0 votes)
34 views

Functions of Operating System

Uploaded by

lancerf61
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Functions of Operating System

Uploaded by

lancerf61
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Functions of Operating System

 Difficulty Level : Easy


 Last Updated : 28 Jun, 2022

Prerequisite – Introduction of Operating System – Set 1


An Operating System acts as a communication bridge (interface)
between the user and computer hardware. The purpose of an
operating system is to provide a platform on which a user can execute
programs in a convenient and efficient manner.
An operating system is a piece of software that manages the allocation
of computer hardware. The coordination of the hardware must be
appropriate to ensure the correct working of the computer system and
to prevent user programs from interfering with the proper working of
the system.
Example: Just like a boss gives orders to his employee, in a similar way
we request or pass our orders to the Operating System. The main goal
of the Operating System is to make the computer environment more
convenient to use and Secondary goal is to use the resources in the
most efficient manner.
What is an Operating System?
An operating system is a program on which application programs are
executed and acts as a communication bridge (interface) between the
user and the computer hardware.
The main task an operating system carries out is the allocation of
resources and services, such as the allocation of memory, devices,
processors, and information. The operating system also includes
programs to manage these resources, such as a traffic controller, a
scheduler, memory management module, I/O programs, and a file
system.
Important functions of an operating System:
1. Security –
The operating system uses password protection to protect user data
and similar other techniques. it also prevents unauthorized access
to programs and user data.

2. Control over system performance –


Monitors overall system health to help improve performance.
records the response time between service requests and system
response to having a complete view of the system health. This can
help improve performance by providing important information
needed to troubleshoot problems.

3. Job accounting –
Operating system Keeps track of time and resources used by
various tasks and users, this information can be used to track
resource usage for a particular user or group of users.

4. Error detecting aids –


The operating system constantly monitors the system to detect
errors and avoid the malfunctioning of a computer system.

5. Coordination between other software and users –


Operating systems also coordinate and assign interpreters,
compilers, assemblers, and other software to the various users of
the computer systems.

6. Memory Management –
The operating system manages the Primary Memory or Main
Memory. Main memory is made up of a large array of bytes or words
where each byte or word is assigned a certain address. Main
memory is fast storage and it can be accessed directly by the CPU.
For a program to be executed, it should be first loaded in the main
memory. An Operating System performs the following activities for
memory management:
It keeps track of primary memory, i.e., which bytes of memory are
used by which user program. The memory addresses that have
already been allocated and the memory addresses of the memory
that has not yet been used. In multiprogramming, the OS decides
the order in which processes are granted access to memory, and for
how long. It Allocates the memory to a process when the process
requests it and deallocates the memory when the process has
terminated or is performing an I/O operation.

7. Processor Management –
In a multi-programming environment, the OS decides the order in
which processes have access to the processor, and how much
processing time each process has. This function of OS is called
process scheduling. An Operating System performs the following
activities for processor management.
Keeps track of the status of processes. The program which performs
this task is known as a traffic controller. Allocates the CPU that is a
processor to a process. De-allocates processor when a process is no
more required.

8. Device Management –
An OS manages device communication via their respective drivers.
It performs the following activities for device management. Keeps
track of all devices connected to the system. designates a program
responsible for every device known as the Input/Output controller.
Decides which process gets access to a certain device and for how
long. Allocates devices in an effective and efficient way. Deallocates
devices when they are no longer required.

9. File Management –
A file system is organized into directories for efficient or easy
navigation and usage. These directories may contain other
directories and other files. An Operating System carries out the
following file management activities. It keeps track of where
information is stored, user access settings and status of every file,
and more… These facilities are collectively known as the file
system.
Moreover, Operating System also provides certain services to the
computer system in one form or the other.
The Operating System provides certain services to the users which can
be listed in the following manner:
1. Program Execution: The Operating System is responsible for the
execution of all types of programs whether it be user programs or
system programs. The Operating System utilizes various resources
available for the efficient running of all types of functionalities.
2. Handling Input/Output Operations: The Operating System is
responsible for handling all sorts of inputs, i.e, from the keyboard,
mouse, desktop, etc. The Operating System does all interfacing in
the most appropriate manner regarding all kinds of Inputs and
Outputs.
For example, there is a difference in the nature of all types of
peripheral devices such as mice or keyboards, the Operating System
is responsible for handling data between them.
3. Manipulation of File System: The Operating System is
responsible for making decisions regarding the storage of all types
of data or files, i.e, floppy disk/hard disk/pen drive, etc. The
Operating System decides how the data should be manipulated and
stored.
4. Error Detection and Handling: The Operating System is
responsible for the detection of any type of error or bugs that can
occur while any task. The well-secured OS sometimes also acts as a
countermeasure for preventing any sort of breach to the Computer
System from any external source and probably handling them.
5. Resource Allocation: The Operating System ensures the proper
use of all the resources available by deciding which resource to be
used by whom for how much time. All the decisions are taken by the
Operating System.
6. Accounting: The Operating System tracks an account of all the
functionalities taking place in the computer system at a time. All the
details such as the types of errors that occurred are recorded by the
Operating System.
7. Information and Resource Protection: The Operating System is
responsible for using all the information and resources available on
the machine in the most protected way. The Operating System must
foil an attempt from any external resource to hamper any sort of
data or information.
All these services are ensured by the Operating System for the
convenience of the users to make the programming task easier. All
different kinds of Operating systems more or less provide the same
services.

Need and Functions of Operating


Systems
The goal of an Operating System: The fundamental goal of an
Operating System is to execute user programs and to make tasks
easier. Various application programs along with hardware systems are
used to perform this work. Operating System is software that manages
and controls the entire set of resources and effectively utilizes every
part of a computer.
The figure shows how OS acts as a medium between hardware units
and application programs.
Need for Operating System:
 OS as a platform for Application programs:
The operating system provides a platform, on top of which, other
programs, called application programs can run. These application
programs help the users to perform a specific task easily. It acts as
an interface between the computer and the user. It is designed in
such a manner that it operates, controls, and executes various
applications on the computer.

 Managing Input-Output unit:


Operating System also allows the computer to manage its own
resources such as memory, monitor, keyboard, printer, etc.
Management of these resources is required for effective utilization.
The operating system controls the various system input-output
resources and allocates them to the users or programs as per their
requirements.
 Consistent user interface:
Operating System provides the user with an easy-to-work
user interface, so the user doesn’t have to learn a different
UI every time and can focus on the content and be
productive as quickly as possible. Operating System
provides templates, and UI components to make the
working of a computer, really easy for the user.

 Multitasking:
Operating System manages memory and allows multiple programs
to run in their own space and even communicate with each other
through shared memory. Multitasking gives users a good experience
as they can perform several tasks on a computer at a time.

Functions of an Operating System :


An operating system has a variety of functions to perform. Some of the
prominent functions of an operating system can be broadly outlined
as:

 Processor Management: This deals with the management of the


Central Processing Unit (CPU). The operating system takes care of
the allotment of CPU time to different processes. When a process
finishes its CPU processing after executing for the allotted time
period, this is called scheduling. There is various type of scheduling
techniques that are used by the operating systems:
1. Shortest Job First(SJF): The process which needs the shortest
CPU time is scheduled first.
2. Round Robin Scheduling: Each process is assigned a fixed CPU
execution time in a cyclic way.
3. Priority Based Scheduling (Non-Preemptive): In this
scheduling, processes are scheduled according to their priorities,
i.e., the highest priority process is scheduled first. If the priorities
of the two processes match, then schedule according to arrival
time.
 Context Switching: In most multitasking OSs, multiple running
processes on the system may need a change of state in execution.
Even if there are multiple processes being executed at any one
point in time, only one task is executed in the foreground, while the
others are put in the background. So the process that is in the
foreground is determined by the priority-based scheduling, and the
OS saves the execution state of the previous process before
switching to the current one. This is known as context switching.

 Device Management:
The Operating System communicates with the hardware and the
attached devices and maintains a balance between them and the
CPU. This is all the more important because the CPU processing
speed is much higher than that of I/O devices. In order to optimize
the CPU time, the operating system employs two techniques –
Buffering and Spooling.
 Buffering:
In this technique, input and output data are temporarily stored in
Input Buffer and Output Buffer. Once the signal for input or output is
sent to or from the CPU respectively, the operating system through
the device controller moves the data from the input device to the
input buffer and from the output buffer to the output device. In the
case of input, if the buffer is full, the operating system sends a
signal to the program which processes the data stored in the buffer.
When the buffer becomes empty, the program informs the operating
system which reloads the buffer and the input operation continues.

 Spooling (Simultaneous Peripheral Operation On Line):


This is a device management technique used for processing
different tasks on the same input/output device. When there are
various users on a network sharing the same resource then it can be
a possibility that more than one user might give it a command at
the same point in time. So, the operating system temporarily stores
the data of every user on the hard disk of the computer to which the
resource is attached. The individual user need not wait for the
execution process to be completed. Instead, the operating system
sends the data from the hard disk to the resource one by one.
Example: printer

 Memory management:
In a computer, both the CPU and the I/O devices interact with the
memory. When a program needs to be executed it is loaded onto
the main memory till the execution is completed. Thereafter that
memory space is freed and is available for other programs. The
common memory management techniques used by the operating
system are Partitioning and Virtual Memory.

 Partitioning:
The total memory is divided into various partitions of the same size
or different sizes. This helps to accommodate a number of programs
in the memory. The partition can be fixed i.e. remains the same for
all the programs in the memory or variable i.e. memory is allocated
when a program is loaded onto the memory. The latter approach
causes less wastage of memory but in due course of time, it may
become fragmented.

 Virtual Memory:
This is a technique used by the operating systems which allows the
user can load programs that are larger than the main memory of the
computer. In this technique, the program is executed even if the
complete program can not be loaded inside the main memory
leading to efficient memory utilization.

 File Management:
The operating system manages the files, folders, and directory
systems on a computer. Any data on a computer is stored in the
form of files and the operating system keeps the information about
all of them using the File Allocation Table (FAT), or a data structure
called an inode in Linux. The FAT stores general information about
files like filename, type (text or binary), size, starting address, and
access mode (sequential/indexed sequential/direct/relative). The file
manager of the operating system helps to create, edit, copy,
allocate memory to the files and also updates the FAT. The
operating system also takes care that files are opened with proper
access rights to read or edit them.
Operating System Services
The main purpose of operating system is to provide environment for
execution of programs. Thus, an operating system provides certain
services to programs and the users of those programs.
1. Program Execution
 Operating system provides a convenient environment where users
can run their programs.
 The operating system performs memory allocation to programs,
load them into appropriate location so that they can execute. The
users not to worry about all these tasks.
2. I/O Operations
 In order to execute a program, it usually requires an I/O operations.
For example, it may need to read a file and print the output.
 When all these I/O operations are performed users cannot control
I/O devices.
 All I/O are performed under the control of operating system.
3. Communication
 The various processes executing on a system may need to
communicate inorder to exchange data or information.
 Operating system provides this communication by using a facility
of message passing. In message passing packets of information are
moved between processes by operating system.

You might also like