UNIT-1 OS Final
UNIT-1 OS Final
INTRODUCTION:
Operating system is a system software that acts as an intermediary between the user of a
computer and computer hardware.
It is considered as the brain of the computer.
It controls the internal activities of the comp. hardware and provides the user interface.
This interface enables a user to utilize the hardware resources very efficiently.
It is the first program that gets loaded into the computer memory through the process
called “booting”.
COMPONENTS OF COMPUTER SYSTEM:
In general we can divide a computer system into the following four components.
Hardware
Operating system
Application programs
Users
As we can see in the figure the user interacts with the application programs.
The application program do not access the hardware resources directly.
HARDWARE resources include I/O devices, primary memory, secondary memory(hard
disk, floppy disk etc.)and the microprocessor.
So the os is required to access and use these resources.
The application programs are programmed in such a way that they can easily
communicate with the resources.
An os is the first program that is loaded into into the computers main memory, when a
computer is switched on.
Some popular os are windows9x(95,98), Linux, Unix, Windows xp.vista etc.
1|Page
OBJECTIVES OF OS:
OS has three main objectives.
Convenience: An OS makes a computer system convenient and easy to use, for the user.
Efficiency: An OS allows the computer to use the computer hardware in an efficient
way, by handling the details of the operations of the hardware.
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 at the same time
interfering with service.
2|Page
The OS is responsible for the following functions related to process management.
i. Process creation (loading the prog. From secondary storage to main
memory)
ii. Process scheduling
iii. Provide mechanism for process synchronization
iv. Provide mechanism for deadlock handling
v. Process termination
5) Peripheral or I/O device Management:
Keep track of resources (device, channels, control units) attached to the system.
Communication between these devices and cpu is observed by OS.
An OS will have device drivers to facilitate I/O functions involving device like
keyboard, mouse, monitor, disk, FDD, CD-ROM, printer etc.
Allocation and De allocation of resources to initiate I/O operation.
Other management activities are
i. Spooling
ii. Caching
iii. Buffering
iv. Device driver interface
6) File Management:
A file is a collection of related information or record defined by the user.
The OS is responsible for various activities of file management are
i. Creation and deletion of files
ii. Creation and deletion of directories
iii. Manipulation of files and directories
iv. Mapping files onto secondary storage
7) Secondary storage Management:
It is a larger memory used to store huge amount of data. Its capacity is much
larger than primary memory. E.g. floppy disk, hard disk etc.
The OS is responsible for handling all the devices that can be done by the
secondary storage management.
The various activities are:
i. Free space management
ii. Storage allocation(allocation of storage space when new files have to be
written).
iii. Disk scheduling(scheduling the request for memory access)
8) Protection/Security Management:
If a computer system has a multiple processor then the various processes must be
protected of one another’s activities.
Protection refers to mechanism for controlling user access of programs or
processes or user to resources defined by the computer system.
9) Error detection and Recovery:
Error may occur during execution like divide by zero by a process, memory
access violation, deadlock, I/O device error or a connection failure.
The os should detect such errors and handles them.
3|Page
CLASSIFICATION / TYPES OF OS
All os consists of similar component and can perform all most similar function but the method
and procedure for performing these functions are different.
OS are classified into different categories according to their different features. The
following section will discuss the classification of OS.
Operating System
Hardware
Advantage:
The CPU has to handle only one application program at a time so that process management
is easy in this environment.
Disadvantage:
As the OS is handling one application at a time most of the CPU time is wasted.
Multi user OS:
In a multi-user os , multiple number of users can access different resources of a computer
at a time.
This system provides access with the help of a network. Network generally consists of
various personal computers that can and receive information to multi user mainframe
computer system.
4|Page
Hence, the mainframe computer acts as the server and other personal computer act as the
client for that server.
Ex: UNIX, Window 2000
Advantage:
Sharing of data and information among different user.
Disadvantage:
Use of expensive hardware for the mainframe computer.
Batch Operating System
In a batch processing operating system interaction between the user and processor is
limited or there is no interaction at all during the execution of work.
Data and programs that need to be processed are bundled and collected as a ‘batch’.
These jobs are submitted to the computer through the punched card. then the job with
similar needs executed simultaneously.
Advantage:
It is simple to implement.
Disadvantage:
Lack of interaction between user and the program.
Multiprogramming OS:
In a multiprogramming os several user can execute
multiple jobs by using a single cpu at the same time.
The os keeps several program or job in the main
memory.
When a job is submitted to the system in a magnetic
disk or job pool.
Then some of the jobs are transferred to the main
memory according to the size of the main memory.
The cpu execute only one job which is selected by the
os.
When the job requires any I/O operation, then cpu
switches to next job in the main memory i.e cpu do not have to wait for the completion of
I/O operation of that job.
When the I/O operation of that job is completed then the cpu switches to the next job
after the the execution of the current job.
E,g.UNIX, Windows 95 etc
Advantage:
Cpu utilization is more i.e the most of the time the cpu is busy.
Disadvantage:
The user can’t directly interact with the system.
Time sharing OS:
This is the Logical extension of multiprogramming system.
The CPU is multiplexed among several jobs that are kept in memory and on disk (the
CPU is allocated to a job only if the job is in memory).
5|Page
Here the cpu can execute more than one job simultaneously by switching among
themselves.
The switching process is very fast so that the user can directly interact with the system
during the execution of the program.
This system stores multiple jobs in the main memory and cpu execute all the jobs in a
sequence.
Generally cpu time is divided into no. of small interval known as time slice period.
Every process has to execute for the time slice period; then the cpu switch over to next
process.
The switching process is very fast,so it seems that several processes are executed
simultaneously.
In above figure the user 5 is active but user 1, user 2, user 3, and user 4 are in waiting state
whereas user 6 is in ready status.
As soon as the time slice of user 5 is completed, the control moves on to the next ready user i.e.
user 6. In this state user 2, user 3, user 4, and user 5 are in waiting state and user 1 is in ready
state. The process continues in the same way and so on.
Advantage:
Cpu utilization is more i.e the most of the time the cpu is busy.
Disadvantage:
The OS is more complex due to memory management, Disk management etc.
Multitasking OS:
A multi-tasking operating system allows
more than one program to be running at
the same time.
E.g.-one user can open the word
document and can simultaneously access
the internet.
While the processor handles only one
application at a particular time it is
capable of switching between the
applications effectively to apparently simultaneously execute each application.
This type of operating system is seen everywhere today and is the most common type of
OS, the Windows operating system would be an example.
6|Page
Multiprocessing OS:
When a system contains more than one processor in close communication, sharing the
computer bus, the clock and sometimes memory and peripheral devices is known as
multiprocessing os.
Advantage:
Improved Reliability:-As the system consists of multiple processor, failure of one
processor does not disturb the computer system. The other processor in the system
continues the task.
Improved throughput:-throughput is defined as the total no of jobs which are excuted
by the cpu in one second. As this system use multiple processor allthe workload divided
between the different processor.
Economical:-in this system different processor share the clock, bus, peripheral and
memory between them. Due to this reason the system are more economical than multiple
single processor system.
7|Page
Real time OS:
In a real-time operating system a job is to be completed within the right time constraint
otherwise job loses its meaning.
These system compete a particular job in the fixed time slot in order to respond to an
event quickly.
Real time introduces for correct operation and it required to produce result within a non
negotiable time period.
Real-time systems are usually used to control complex systems that require a lot of
processing like machinery and industrial systems.
This is of 2 types:
Hard real time OS
Soft real time OS
8|Page
Peer –to-peer model: In a peer-to-peer model,all the computers
behave
as peers as well as clients. These peers communicate with each other for
exchange of their resources.
Advantages:
It facilitates the sharing of hardware and software resources between different processors.
It increases reliability as failure of one node does not affect the entire network.
It increases the computational speed of computer by sharing the workload into different
nodes.
It enable different users to communicate with each other using email.
9|Page
The shell read the commands, what you typed at command line and interprets them
and sends request to execute a program. That’s why shell is called as command line
interpreter.
Hardware:
Computer hardware refers to the physical parts or components of a computer such as
the monitor, mouse, keyboard, computer data storage, hard drive disk (HDD), system
unit (graphic cards, sound cards, memory, motherboard and chips), etc. all of which
are physical objects that can be touched
10 | P a g e