Introduction To Operating Systems
Introduction To Operating Systems
Memory Management
Processor Management
Device Management
File Management
Security
Job accounting
Memory Management
Memory management refers to management of Primary Memory or Main Memory.
Main memory is a large array of words or bytes where each word or byte has its own
address.
Main memory provides a fast storage that can be access directly by the CPU. So for
a program to be executed, it must in the main memory. Operating System does the
following activities for memory management.
Keeps tracks of primary memory i.e. what part of it are in use by whom, what
part are not in use.
De-allocates the memory when the process no longer needs it or has been
terminated.
Processor Management
In multiprogramming environment, OS decides which process gets the processor
when and how much time. This function is called process scheduling. Operating
System does the following activities for processor management.
Keeps tracks of processor and status of process. Program responsible for this
task is known as traffic controller.
Device Management
OS manages device communication via their respective drivers. Operating System
does the following activities for device management.
Keeps tracks of all devices. Program responsible for this task is known as the
I/O controller.
Decides which process gets the device when and for how much time.
De-allocates devices.
File Management
A file system is normally organized into directories for easy navigation and usage.
These directories may contain files and other directions. 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.
Job accounting -- Keeping track of time and resources used by various jobs
and users.
The users of batch operating system do not interact with the computer directly.
Each user prepares his job on an off-line device like punch cards and submits it to
the computer operator. To speed up processing, jobs with similar needs are batched
together and run as a group. Thus, the programmers left their programs with the
operator. The operator then sorts programs into batches with similar requirements.
The problems with Batch Systems are following.
CPU is often idle, because the speeds of the mechanical I/O devices is slower
than CPU.
Problem of reliability.
With resource sharing facility user at one site may be able to use the
resources available at another.
Speedup the exchange of data with one another via electronic mail.
If one site fails in a distributed system, the remaining sites can potentially
continue operating.
OPERATING SERVICES
An Operating System provides services to both the users and to the programs.
Program execution
I/O operations
Communication
Error Detection
Resource Allocation
Protection
Program execution
Operating system handles many kinds of activities from user programs to system
programs like printer spooler, name servers, file server etc. Each of these activities
is encapsulated as a process.
A process includes the complete execution context (code to execute, data to
manipulate, registers, OS resources in use). Following are the major activities of an
operating system with respect to program management.
I/O Operation
I/O subsystem comprised of I/O devices and their corresponding driver software.
Drivers hides the peculiarities of specific hardware devices from the user as the
device driver knows the peculiarities of the specific device.
Operating System manages the communication between user and device drivers.
Following are the major activities of an operating system with respect to I/O
Operation.
I/O operation means read or write operation with any file or any specific I/O
device.
Operating system provides the access to the required I/O device when
required.
The operating system gives the permission to the program for operation on
file.
Communication
In case of distributed systems which are a collection of processors that do not share
memory, peripheral devices, or a clock, operating system manages communications
between processes. Multiple processes with one another through communication
lines in the network.
OS handles routing and connection strategies, and the problems of contention and
security. Following are the major activities of an operating system with respect to
communication.
The both processes can be on the one computer or on different computer but
are connected through computer network.
Error handling
Error can occur anytime and anywhere. Error may occur in CPU, in I/O devices or in
the memory hardware. Following are the major activities of an operating system
with respect to error handling.
Resource Management
In case of multi-user or multi-tasking environment, resources such as main memory,
CPU cycles and files storage are to be allocated to each user or job. Following are
the major activities of an operating system with respect to resource management.
Protection
Considering a computer systems having multiple users the concurrent execution of
multiple processes, then the various processes must be protected from each
another's activities.
Protection refers to mechanism or a way to control the access of programs,
processes, or users to the resources defined by a computer systems. Following are
the major activities of an operating system with respect to protection.
OS ensures that external I/O devices are protected from invalid access
attempts.
OS keeps a number a jobs in memory and executes them without any manual
information.
Jobs are processed in the order of submission i.e first come first served
fashion.
When job completes its execution, its memory is released and the output for
the job gets copied into an output spool for later printing or processing.
Advantages
Batch processing takes much of the work of the operator to the computer.
Increased performance as a new job get started as soon as the previous job
finished without any manual intervention.
Disadvantages
Due to lack of protection scheme, one batch job can affect pending jobs.
Multitasking
Multitasking refers to term where multiple jobs are executed by the CPU
simultaneously by switching between them.Switches occur so frequently that the
users may interact with each program while it is running. Operating system does
the following activities related to multitasking.
Operating System handles multitasking in the way that it can handle multiple
operations / executes multiple programs at a time.
When a process executes, it typically executes for only a very short time
before it either finishes or needs to perform I/O.
Since interactive I/O typically runs at people speeds, it may take a long time
to completed. During this time a CPU can be utilized by another process.
As the system switches CPU rapidly from one user/program to the next, each
user is given the impression that he/she has his/her own CPU, whereas
actually one CPU is being shared among many users.
Multiprogramming
When two or more programs are residing in memory at the same time, then sharing
the processor is referred to the multiprogramming. Multiprogramming assumes a
single shared processor. Multiprogramming increases CPU utilization by organizing
jobs so that the CPU always has one to execute.
Following figure shows the memory layout for a multiprogramming system.
This set of jobs is a subset of the jobs kept in the job pool.
The operating system picks and begins to execute one of the job in the
memory.
Advantages
User feels that many programs are allotted CPU almost simultaneously.
Disadvantages
Interactivity
Interactivity refers that a User is capable to interact with computer system.
Operating system does the following activities related to interactivity.
OS managers input devices to take inputs from the user. For example,
keyboard.
OS Response time needs to be short since the user submits and waits for the
result.
In such systems, Operating Systems typically read from and react to sensor
data.
Distributed Environment
Distributed environment refers to multiple independent CPUs or processors in a
computer system. Operating system does the following activities related to
distributed environment.
Spooling
Spooling is an acronym for simultaneous peripheral operations on line. Spooling
refers to putting data of various I/O jobs in a buffer. This buffer is a special area in
memory or hard disk which is accessible to I/O devices. Operating system does the
following activites related to distributed environment.
OS handles I/O device data spooling as devices have different data access
rates.
OS maintains the spooling buffer which provides a waiting station where data
can rest while the slower device catches up.
Advantages
Spooling is capable of overlapping I/O operation for one job with processor
operations for another job.