Operating system notes
Operating system notes
rodon;
Gene
2
vd Batch Processing Operating System:
batches of
The first computers used batch operating systems, in which the computer ran
jobs without stop. The job is usually in the form of punch cards. Ina batch processing
no
operating system interaction between the user and processor is limited or there is
interaction at all during the execution of work. Data and programs that need to be
processed are bundled and collected as a 'batch and executed together.
Scheduling in batch systems is also very simnple. Memory is divided into two areas. One
of them ispermanently occupied by the resident portion of the operating system , and the
other is used to load transient programs for execution. When a transient program
terminates , a new program is loaded into the same area of memory.
Batch processing operating systems are ideal in situations where: manayen the eecuttin t
- Thereare large amounts of data to be processed. fah Pray ram in the bte
- Similar data needs to be processed.
- Similar processing is involved when executing the data. The mowtr i's alw ays n the
nian me my aad aveulble
Advantages of batch systems:
move much of the work of the operator to the computer
increased performance since it was possible for job to start as soon as the
previous job finished
A u obs w e e
batehedthyethe Disadvantages:turn-around time can be large from user standpoint
z*FeRTRAN
more difficult to debug program
Co30L due to lack of protection scheme, one batch job can affect pending jobs
(read too many cards, etc)
a job could corrupt the monitor, thus affecting pending jobs
a job could enter an infinite loop
Professional operators, not the users, interacted with the machine. Users dropped jobs off,
for the
then returned to pick up the results after their jobs had run. This was inconvenient
users, but the expensive computer was kept busy with a steady stream of jobs.
6S CPU
Ceney
2
1960's
Multi Programming Operating System:
Importance of Multiprogramming Operating System:
Usually ,a CPU is much faster compared to
peripheral devices. While peripherals are
performing certain operations the CPUmay not
Tokeep CPU be doing any work. It may be lying idle.
busy for most of the time it is desirable to
process a number of programs
concurrently.When a computer processes several
or execution of programs is called programs concurrently, such processing
multiprogramming.
The term multiprogramming denotes an operating
forms of memory protection and enforces system that provides sophisticated
concurrency control when processes access
shared I/O devices and files. Multiprogramming
jobs so that the CPUalways has one to execute. increases CPU utilization by organizing
The idea is as follows- The operating system keeps several
simultaneously. This set of jobs isa subset of the jobs kept injobs
in memory
the
system picks and begins to execute one of the jobs in the memory.job pool. The operating
Eventually, the job may have to wait for sone task, such as an I/O
In anon-multiprogramming system, theoperating system switches operation,
to complete.
to, and executes,
another job. When that job needs to wait, the CPU is switched to another job, and so on.
As soon as, the first job finishes waiting and gets the CPUback.
As long as at least one job needs to execute , the CPUis never idle.
In the early days of computing, CPU time was expensive, and peripherals were very
siow. When the computer ran aprogram that needed aCcess to aperipheral, the CPU
Would have to stop executing program instructions while the peripheral processed
the data. This was deemed very inefficient. The first computer using a multitasking
system was the British Leo III owned by J. Lyons and Co.. Several different
programs in batch were loaded in the computer memory, and the first one began to
run. When the first program reached an instruction waiting for a peripheral, the
context of this program was stored away, and the second program in memory was
given a chance to run. The process continued until all programs finished running.
Multiprogramming doesn't give any guarantee that a program will run in a timely
manner. Indeed, the very first program may very well run for hours without needing
access to aperipheral. As there were no users waiting at an interactive terminal, this
was no problem: users handed on adeck of punched cards to an operator, and came
back a few hours later for printed results. Multiprogramming greatly reduced wait
times when multiple batches were being processed.
The mismatch between the speeds of input / output device and CPUleaves some
However , if the computer system is
resources of the computer system under utilized.
utilization of the available equipment can
working in the multiprogramming mode, better several programs in different parts of the
be realized multi programming refers to keeping andexecuting them concurrently by
main memory are the same time as shown in figure
the CPU.
instantaneously. Since the
The CPU switches from one program to another almostoperations, the CPU can allocate
operating speed of CPUis much faster than that of I/O is busy with I/O operations.
time to several programs Instead of remaining idle when onewaiting for I/O transfer, there
Hence, in multiprogramming system, when one program is
is another progranm ready to use the CPU. Job 3
At the particular time instance shown in the figure,
program A isnot utilizing the CPUsince it is busy Job 2
in writing output data on the disk. The CPUis being Memory
used to execute program B which is also present in Job 1 partitions
the main memory. Another program C, residing in
the main memory, is waiting for the CPUto become
free. Operating
system
In case of multiprogramming the various programs
stored in the main memory, can be in one of the following three stages:
Advantages of multiprogramming:
1. Increased Throughput
Throughput isa measure of the total amount of processing that a computer system can
complete over a fixed period of time. Total through put is significantly increased in
multiprogramming because the CPU is not waiting for VO for the program it is executing.
2. Shorter Response Time
Turn around time for short jobs can be greatly improved under multiprogramming.
priorities of jobs
3. Ability toassign
systems have schemes for setting priorities for rotating
Most multiprogramming
programs.
Storage Allocation
1. Improved Primary :
programs that primary storage can hold, the greater the
The greater the number of program while waiting for
execute at least one
probability that the CPUwill be able to
I/O for the others.
Multiprogramming Operating Systems
(Requirements or Disadvantages of
d1960's-19cs
1. Large Main Memory
accommodate many user programs along with
Large main memory is required to
operating systems.
SPOoLing 2. Proper Job Mix
bound
should contain some CPU- bound programs and some I/O -
The main memory least one of the programs which do
not need
various partitions so that at
programs in its
processing.
VO is always available to the CPUfor
3. CPUScheduling
situations which two or more programs will be in the ready statewaiting for
There will be case, the operating system just decides to
CPUto be allocated for execution. In such a
allocated.
which program CPU should be
Time Sharing: in this operating system OS assigns some time slots to cach job. Here cach
job is executed according to the allotted time slots.
Jobl: 0 to 5
Job2: 5 to 10
Job3: 10 to 15
Multi-Tasking: in this operating system jobs are executed in parallel by the operating
system. But we can achieve this multi-tasking through multiple processors (or) CPUs
only.
CPU1: Jobl
CPU2: Job2
CPU3:Job3
6
GLeneYho
Late to’treser
E.g. Multimedia, virtual reality, Advanced Scientific Projects like undersea exploration
and planetary rovers.
A hard real-time operating system has less jitter than a soft real-time operating system.
The chief design goal is not high throughput, but rather a guarantee of a soft or hard
performance category. A RTOS that can usually or generally meet a deadline is a soft
real-time OS, but if it can meet a deadline deterministically it is a hard real-time OS.
Reliability:If one site fails in adistributed system, the remaining sites can potentially
continue operating.