Computer Application Unit 5
Computer Application Unit 5
An Operating System (OS) is an interface between a computer user and computer hardware. An operating
system is a software which performs all the basic tasks like file management, memory management, process
management, handling input and output, and controlling peripheral devices such as disk drives and printers.
Some popular Operating Systems include Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc.
Definition
An operating system is a program that acts as an interface between the user and the computer hardware and
controls the execution of all kinds of programs.
Memory Management
Processor Management
Device Management
File Management
Security
Control over system performance
Job accounting
Error detecting aids
Coordination between other software and users
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 accessed directly by the CPU. For a program to be
executed, it must in the main memory. An 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.
In multiprogramming, the OS decides which process will get memory when and how
much.
Allocates the memory when a process requests it to do so.
De-allocates the memory when a process no longer needs it or has been terminated.
Processor Management
In multiprogramming 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 −
Keeps tracks of processor and status of process. The program responsible for this task is
known as traffic controller.
Allocates the processor (CPU) to a process.
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. Program responsible for this task is known as the I/O
controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
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.
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.
Decides who gets the resources.
Allocates the resources.
De-allocates the resources.
Multiple jobs are executed by the CPU by switching between them, but the switches occur so frequently.
Thus, the user can receive an immediate response. For example, in a transaction processing, the processor
executes each user program in a short burst or quantum of computation. That is, if nusers are present, then
each user can get a time quantum. When the user submits the command, the response time is in few seconds
at most.
The operating system uses CPU scheduling and multiprogramming to provide each user with a small portion
of a time. Computer systems that were designed primarily as batch systems have been modified to time-
sharing systems.
Problem of reliability.
Question of security and integrity of user programs and data.
Problem of data communication.
With resource sharing facility, a 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.
Better service to the customers.
Reduction of the load on the host computer.
Reduction of delays in data processing.
The OS defines a job which has predefined sequence of commands, programs and data as
a single unit.
The 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 a 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 is finished,
without any manual intervention.
Disadvantages
Difficult to debug program.
A job could enter an infinite loop.
Due to lack of protection scheme, one batch job can affect pending jobs.
Multitasking
Multitasking is when 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. An OS does
the following activities related to multitasking −
The user gives instructions to the operating system or to a program directly, and receives
an immediate response.
The OS handles multitasking in the way that it can handle multiple operations/executes
multiple programs at a time.
Multitasking Operating Systems are also known as Time-sharing systems.
These Operating Systems were developed to provide interactive use of a computer system
at a reasonable cost.
A time-shared operating system uses the concept of CPU scheduling and
multiprogramming to provide each user with a small portion of a time-shared CPU.
Each user has at least one separate program in memory.
A program that is loaded into memory and is executing is commonly referred to as
a process.
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 slower speeds, it may take a long time to complete.
During this time, a CPU can be utilized by another process.
The operating system allows the users to share the computer simultaneously. Since each
action or command in a time-shared system tends to be short, only a little CPU time is
needed for each user.
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
Sharing the processor, when two or more programs reside in memory at the same time, is referred
as multiprogramming. Multiprogramming assumes a single shared processor. Multiprogramming increases
CPU utilization by organizing jobs so that the CPU always has one to execute.
The following figure shows the memory layout for a multiprogramming system.
Advantages
Disadvantages
Interactivity
Interactivity refers to the ability of users to interact with a computer system. An Operating system does the
following activities related to interactivity −
The response time of the OS 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.
The Operating system must guarantee response to events within fixed periods of time to
ensure correct performance.
Distributed Environment
A distributed environment refers to multiple independent CPUs or processors in a computer system. An
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.
Handles I/O device data spooling as devices have different data access rates.
Maintains the spooling buffer which provides a waiting station where data can rest while
the slower device catches up.
Maintains parallel computation because of spooling process as a computer can perform
I/O in parallel fashion. It becomes possible to have the computer read data from a tape,
write data to disk and to write out to a tape printer while it is doing its computing task.
Advantages