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

Functions of OS

Operating system

Uploaded by

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

Functions of OS

Operating system

Uploaded by

59mansikangs4
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Functions of Operating System

Functions of Operating System :


1. Process Management
2. Main Memory Management
3. Secondary Storage Management
4. File Management
5. Input/Output or Device Management
6. Protection and Security
7. Networking
8. Command Interpretation
1. Process Management
Process
A process is a program in execution.
• To understand the importance of this definition,
let us imagine that we have written a program
called my_prog.c in C language.
• On execution, this program may read in some
data and output some data. When a program is
written and a file is prepared, it is still a script i.e., it
cannot cause any input, processing or output to
happen. Once we compile, and still later when we
run this program, the intended operations take
place.
Process
A process is a program in execution.
• In other words, a program is a text script with no
dynamic behavior. When a program is in execution,
the script is acted upon. It can result in engaging a
processor for some processing and it can also
engage in I/O operations.
• It is for this reason a process is differentiated
from program. While the program is a text script, a
program in execution is a process. Program is a
passive entity, process is an active entity.
Process
• A process is a program in execution.
• It is the job which is currently being executed by the processor
(CPU)
• Program is a passive entity, process is an active entity.
• Process needs resources to accomplish its task CPU, memory, I/O,
files Initialization data
• Process termination requires reclaim of any reusable resources
• Single-threaded process has one program counter specifying
location of next instruction to execute
• Process executes instructions sequentially, one at a time, until
completion
• Multi-threaded process has one program counter per thread
• Typically system has many processes, some user, some operating
system running concurrently on one or more CPUs
OS Process Management Activities
1. Creating and deleting both user and system
processes
2. Suspending and resuming processes
3. Assigning required resources to different processes
currently running
4. Providing mechanisms for process synchronization
5. Providing mechanisms for process communication
6. Providing mechanisms for deadlock handling
2. Memory Management
Memory
• Memory is an important resource for a computer system.
• Memory is organized as a large array of words or bytes that
stores the user programs and instructions for execution.
• Main memory is usually shared by OS and application
programs.
• The memory manager keeps track of area of memory where
OS resides and where Application program resides.
• In multi programming environment several program or
processes are kept in main memory so as to increase CPU
utilization and decrease response time.
• So memory allocation and deallocation for programs and data
is an another function of an operating system.
• Memory management also implements protection
mechanism in order to protect the allocated memory from
unauthorized access.
OS Memory Management Activities
1. Keeping track of which parts of memory are
currently being used and by whom
2. Deciding which processes (or parts thereof) and
data to move into and out of memory
3. Allocating and deallocating memory space to the
various programs needed
3. Secondary (Mass) Storage Management
Secondary (Mass) Storage Management
• Usually disks used to store data that does not fit in
main memory or data that must be kept for a “long”
period of time
• Proper management is of central importance
• Entire speed of computer operation hinges on disk
subsystem and its algorithms
OS Mass-Storage Management Activities
• Free-space management
• Storage allocation
• Disk scheduling
• Tertiary storage includes optical storage, magnetic
tape Varies between WORM (write-once, read-
many-times) and RW (read-write) need to managed
4. File Management
• A computer system processes and stores information.
• Usually, during processing computers need to
frequently access primary memory for instructions and
data.
• However, the primary memory can be used only for only
temporary storage of information. This is so because
the primary memory of a computer system is volatile.
• The secondary memory, on the other hand, is non-
volatile. This means that once the user has finished his
current activity on a computer and shut down his
system, the information on disks (or any other form of
secondary memory) is still available for a later access.
The non-volatility of the memory enables the disks to
store information indefinitely.

• Users think of all such information as files.
• OS provides support for such management through
a file system.
• File system is the software which empowers users
and applications to organize and manage their files.
• The organization and management of files may
involve access, updates and several other file
operations.
File
• Data is stored in a computer system as files. OS
provides uniform, logical view of information
storage in the form of file.
• Files usually organized into directories
• Files and directories are also properly managed by
an operating system
OS File Management Activities

• Creating and deleting files and directories


• Primitives to manipulate files and directories
(naming, sharing, reading, writing, protection)
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage
media
5. I/O Management
I/O Subsystem
• I/O devices attached to computer system are used to enter data
into the system and get the output.
• I/O subsystem manages all the I/O devices and contains a
variety of software programs to handle these devices (called
device driver)
• A device driver is a software module that manages the
communication and controls the specific I/O device. Device
driver converts the logical requests from the user into specific
commands directed to the device itself.
• I/O subsystem also implements device allocation policies. It
keeps an account to determine which device is allocated to
which process. It also looks after the allocation of devices to
the processes and reclaim them when processes do not need
them.
OS I/O Subsystem management activities
• keeps track of input and output requests, issues
commands to these devices and take measures which
would ensure that data is transmitted efficiently and
correctly to and from input and output devices
• Allocates resources in efficient manner(I/O scheduling)
• I/O subsystem responsible for Memory management of
I/O including buffering (storing data temporarily while
it is being transferred), caching (storing parts of data in
faster storage for performance), spooling (the
overlapping of output of one job with input of other
jobs)
• manages drivers for specific hardware devices
• Reclaim the resources.
6. Protection and Security
Protection and Security
• The security modules of an Operating System
protect the resources & information of a computer
system against destruction& unauthorized access.
• This module of the operating system executes
concurrently in the memory, in such a way system
ensures data security and integrity. That is, It keeps
different programs and data in such a way that they
do not interfere with each other. Moreover, it
protects files from being accessed or modified by
unauthorized users.
Protection and Security
• Protection mechanism controls the access of users ,
programs and processes used by various applications.
• It also controls the access of processes or users to
resources defined by the OS .
• Security –defense of the system against internal and
external attacks e.g. Huge range including denial-of-
service, worms, viruses, identity theft, theft of service
• Systems generally distinguish among users, to
determine who can do what by providing user
authentication and access control.
7. Networking
Networking
• Networking is used for exchanging information among
different computers that are distributed across various
locations.
• It also enable to share various resources of the network.
• The processors in distributed system vary in size and
function.
• The various processors communicate using communication
lines, such as telephone lines and buses. Bus is collection of
wires that run parallel across the width of motherboard.
• Networking results in computational speed up, increased
functionality, increased data availability and better
reliability.
8. Command Interpretation
Command Interpretation
• Command Interpreter is the basic interface
between computer and user.
• It provides a set of commands using which the
user can give instructions to the computer for
getting some job done by it.
• The various commands supported by command
interpretation modules are called system calls.
• It hides the hardware details of the system from
the user.
Command Interpretation
• The operating system offers two types of the
interface to the user:
1. Graphical-line interface(GUI): It interacts with of
visual environment to communicate with the
computer. It uses windows, icons, menus and other
graphical objects to issues commands.
2. Command-line interface(CUI): it provides an
interface to communicate with the computer by
typing commands.
Some question now you can answer:
• What are different functions performed by a
operating system?
• What is process? What are the main
objectives of the process-management
module of the operating system?

You might also like