Lecture2 OS
Lecture2 OS
Lecture2 OS
3
Hardware Complexity Increases
4
OS needs to keep pace with hardware
improvements
5
Evolution of an Operating Systems?
• Structure
• Single user system.
• Programmer/User as operator (Open Shop).
• Large machines run from console.
• Paper Tape or Punched cards.
Example of an early computer system
Characteristics of Early Systems
• Now, a red light was used to detect the error in the program execution.
So, if there was any error, the error got detected due to red blinking
lights.
Drawbacks of Serial Operating System
• Problems:
– 1. How does the monitor know about the nature of the job (e.g.,
Fortran versus Assembly) or which program to execute?
– 2. How does the monitor distinguish:
(a) job from job?
(b) data from program?
• Solution: Introduce Job Control Language (JCL) and
control cards.
Control Cards (2)
• Each read instruction (in user program) causes one line of input to be read.
• Causes (OS) input routine to be invoked:
• checks for not reading a JCL line.
• skip to the next JCL line at completion of user program.
Resident Monitor
• Memory protection
• do not allow the memory area containing the monitor to be altered by a
user program.
• Privileged instructions
• can be executed only by the resident monitor.
• A trap occurs if a program tries these instructions.
• Interrupts
• provide flexibility for relinquishing control to and regaining control from
user programs.
• Timer interrupts prevent a job from monopolizing the system .
Offline Operation
• Problem:
• Card Reader slow, Printer slow (compared to
Tape).
• I/O and CPU could not overlap.
• Solution: Offline Operation (Satellite Computers) :
speed up computation by loading jobs into memory
from tapes while card reading, and line printing is
done off-line using smaller machines.
Spooling (1)
• Problem:
• Card reader, Line printer and Tape drives slow
(compared to Disk).
• I/O and CPU could not overlap.
• Solution: Spooling -
• Overlap I/O of one job with the computation of
another job (using double buffering, DMA, etc).
• Technique is called SPOOLing: Simultaneous
Peripheral Operation On Line.
Spooling (2)
• While executing one job, the OS:
• Reads next job from card reader into a storage area on the disk (Job pool).
• Outputs printout of previous job from disk to printer.
• Job pool – data structure that allows the OS to select which job to run next
in order to increase CPU utilization.
We assumed Uniprogramming until now
Several jobs are kept in main memory at the same time, and the CPU is
multiplexed among them.
Multiprogramming (1)
Multiprogramming (2)
What is Multiprogramming?
• In multi-programming more than one process can reside in the main
memory at a time. Thus, when process P1 goes for I/O operation the CPU is
not kept waiting and is allocated to some another process (lets say P2). This
keeps the CPU busy at all times.
• Use interrupts to run multiple programs simultaneously
● When a program performs I/O, instead of polling, execute another
program till interrupt is received.
● Requires secure memory, I/O for each program.
● Requires intervention if program loops indefinitely.
● Requires CPU scheduling to choose the next job to run.
40
Why Multiprogramming?
Multiprogramming needed for efficiency:
• Single user cannot keep CPU and I/O devices busy at all times.
• Multiprogramming organizes jobs (code and data) so CPU always has one
to execute.
• A subset of total jobs in system is kept in memory.
• One job selected and run via job scheduling.
• When it has to wait (for I/O for example), OS switches to another job.
Multiprogramming
• Advantages:
1. CPU is being utilized all the time as long as there are more than 1 process
2. The processes can be finished in less amount of time
• Disadvantages:
• 1. No user interaction
Types of Multiprogramming OS
There mainly two types of multiprogramming operating systems:
• Multitasking Operating System
• Multiuser Operating System
• Multi-tasking examples are: Windows XP, Windows Vista, Windows 7, Windows 8 and
more.
Types of Multiprogramming OS
• Multiuser Operating System: When an operating system allows too many users to make
connection with single system running the same operating system is called the multiuser
operating system.
• While using on multi user operating system, we are able to operate several programs at
once and going out a couple of tasks simultaneously. The main objective for designing a
multi-user operating system is that it lets to use batch processing system and time
sharing over the mainframe computer. Multi-user operating system is mostly used in
enlarge organization, campus and universities, public sector and so on. With using of
multiuser OS, you are going to exchange files or data, and several hardware components
such as printer, plotter, and hard drives. Every user grabs a short period of CPU time for
this.
• Multiuser OS examples are: Windows 2000, Ubuntu, Mac OS, Linux, Unix, and more.
Difference between Multiprogramming and
Multitasking
Multiprogramming:
Multi-tasking:
• Approach of context switching and time sharing is implemented
Evolution of Operating Systems
47
Timesharing (cont.)
● Interactive (action/response)
● when OS finishes execution of one command, it seeks the next control
statement from user.
● File systems
● online filesystem is required for users to access data and code.
● Virtual memory
● Job is swapped in and out of memory to disk.
48
Timesharing (cont.)
49
Timesharing (cont.)
• In the time-sharing operating system, several jobs or processes can be
loaded into the main memory simultaneously and several users can share
the system as well.
• We can hence, say that the time-sharing operating system was a logical
extension of the multiprogramming operating system.
• The name time-sharing was used because the processes used to share an
equal amount of time specified by the operating system developer.
• The main aim of the time-sharing operating system was to reduce the
overall process response time.
• The CPU could execute several processes by providing an equal amount of
time to each process, so the CPU utilization became better than the
multiprogramming operating system.
50
Timesharing (cont.)
Note: Response time is the total amount of time it takes to respond to a
process. It should not be confused with the execution time. The switching
between several operating system processes was handled by an operating
system subprocess knew as the CPU scheduler.
52
Evolution of Operating Systems
54
Evolution of Operating Systems
56
What is a Multiprocessor System?
57
Multiprocessor System
58
Advantages of Multiprocessor Systems
There are list of several advantages of Multiprocessor operating system such as
• Great Reliability
• If due to any reason, any one processor gets fails then do not worry because,
entire system will do work properly. For example – if multiprocessor has 6
processors and any one processor does not perform properly, at this stage
rest of them processors have to responsibilities for handling this system.
• Improve Throughput
• Enhancing the throughput of system, entire system is improved, if couples
of processors work with getting collaboration.
59
Advantages of Multiprocessor Systems
• Cost Effective System
• Multiprocessor systems are cost effective compare to single processor
system in long life because this system is capable to share all input/output
devices, power supplies system, and data storage center. In multiprocessor,
do not need to connect all peripheral terminals separately with each
processor.
• Parallel Processing
• Multiprocessor O/S gets high performance due to parallel processing. In
this system, single job is divided into various same small jobs, and execute
them like as Parallel nature.
60
Disadvantages of Multiprocessor Systems
• Multiprocessor has complicated nature in both form such as H/W and S/W.
• It is more expensive due to its large architecture.
• Multiprocessor operating system has a daunting task for scheduling
processes due to its shareable nature.
• Multiprocessor system needs large memory due to sharing its memory with
other resources.
• Its speed can get degrade due to fail any one processor.
• It has more time delay when processor receives message and take
appropriate action.
• It has big challenge related to skew and determinism.
• It needs context switching which can be impacted its performance.
61
Examples of Multiprocessor Systems
• Examples for Symmetric Multiprocessor – Windows NT, Solaris, Digital
UNIX, OS/2 & Linux.
• Examples for Asymmetric Multiprocessor – SunOS Version 4, IOS
62
Evolution of Operating Systems
65
Distributed Systems
Client-Server Systems
Client-Server Systems is known as “Tightly Coupled Operating System”. This
system is designed mostly for multiprocessors and homogeneous
multicomputer. Client-Server Systems works as a centralized server because it
provides the approval to all requests, which are generated by client systems
side.
67
Types of Distributed Systems
File Server System: File server allows the file system interface for clients
because their clients can be performed various tasks such as creation, updating,
deletion files, and more.
68
Types of Distributed Systems
Peer-to-Peer System
Peer-to-Peer System is known as a “Loosely Couple System”. This concept is
implemented in the computer network application because it contains the bunch
of processors, and they are not shareable memories or clocks as well. Every
processors consist own local memory, and these processors make
communication with each other through various communication medium such
as high speed buses or telephone lines.
69
Types of Distributed Systems
Middleware
Middleware allows the interoperability in the between of all applications, which
are running on other operating systems. With using these services those
applications are capable for transferring all data each other.
70
Applications of Distributed Systems
72
Advantages of Distributed Systems
• It can share all resources such as (CPU, disk, network interface, nodes,
computers, and more) from one site to another site, and it increases the data
availability on entire system.
• It enhances the speed of data exchange from one site to other site.
• It reduces the probability of data corruption because all data are replicated
on all site, if any site gets fail then user can access data from other running
site.
• It provides excellent services to all users.
• It helps to decrease the load of jobs on one host system.
• It can be scaled easily; it means any network can be attached with other
network without hindrance.
• It is more reliable to single system.
• It has excellent performance. 73
Advantages of Distributed Systems
• Better portability.
• Better re-usability of existing hardware components.
• It helps to decrease the duration time in data processing.
• It is high fault tolerance system.
• Better flexibility, due to easy to use, install and error detection.
• It is openness system because this system can be accessed from local and
remote sites.
• Entire system works independently from each other and due to this feature if
any one site gets crash then entire system does not halt.
• Well protective system because in distributed operating system, every users
has unique UID and with using this UID all users can use every system. Due
to UID, no chance hack data from this system.
74
Limitations of Distributed Systems
75
Limitations of Distributed Systems
• If, some time anyone site gets overload then it can be created big challenges.
• If, same time multiple users try to access same data from local database as
well as remote data base then its performance can get degrade.
76
Summary
78
Summary