You are on page 1of 45

Introduction

Operating systems manage each/every computer part


(hardware and software) understanding Operating systems, is
actually - understanding the workings of the entire computer
system.

So, in this course we ask these questions, which will be


answered as we go on.
 What is an Operating System?
 What does it do anyway?
 Why does it do what it does?
 By the way, how does it do it?

Operating System Concepts


Chapter 1: Introduction
 What is an Operating System?
 Mainframe Systems
 Desktop Systems
 Multiprocessor Systems
 Distributed Systems
 Clustered System
 Real -Time Systems
 Handheld Systems
 Computing Environments

Operating System Concepts


What is an Operating System?
 A program that acts as an intermediary between a user of a
computer and the computer hardware. As an Intermediary, it
provides an environment in which the user can execute
programs.

Operating system goals:


 To execute user programs and make solving user problems
easier.
 To make the computer system convenient to use.
 To use the computer hardware in an efficient manner
(optimal use of computing resources).

Operating System Concepts


Computer System Components
There are 4 main components of a Computer System, namely;
1. Hardware – provides basic computing resources (CPU,
memory, I/O devices).
2. Operating system – controls and coordinates the use of the
hardware among the various application programs for the
various users.
3. Applications programs – define the ways in which the system
resources are used to solve the computing problems of the
users (compilers, database systems, video games, business
programs).
4. Users –try to solve different problems (people, machines,
other computers).

Operating System Concepts


Abstract View of System
Components

Operating System Concepts


Operating System Definitions
 Resource Allocator – OS manages and allocates resources (hardware
& software-CPU, memory & file storage space, I/O devices etc) to
specific programs and users. Incase of conflicting requests for
resources, OS decides which requests are allocated resources to
ensure fair & efficient computer usage.
 Control Program – OS controls the execution of user programs to
prevent errors & improper use of the computer. Also concerned with
operation and control of I/O devices.
 Kernel – OS is the one program running at all times on the computer-
usually called the kernel (with all else being application programs).

There is no completely adequate definition of an


OSs are easier defined by what they do rather than
what they are.
Operating System Concepts
Mainframe Systems
Batch Systems
 Reduced setup time by batching similar jobs which were then
run through the computer as a group. But the CPU sat idle
during the transition from one job to another.
 Automatic job sequencing was required; i.e. automatically
transferring control from one job to another. This led to the
creation of the first rudimentary/basic operating systems.
 Resident Monitor: a procedure for automatically transferring
control from one job to the next. It is always (resident) in
memory.
 When the computer was turned on, RM was invoked,
 It would then transfer control to a program

Operating System Concepts


 if a program terminated- it would return control to RM,
which would then go on to the next program. RM would
automatically sequence from one program (e.g. FOTRAN,
Assembler etc) to another and from one job to another.

How would RM know which program to execute?


By use of control cards which contained directives to RM
indicating the program to run.

Control Card Interpreter- is a part RM that reads & carries out


the instructions on the cards at the point of execution

Operating System Concepts


Memory Layout for a Simple Batch System

Operating System Concepts


 Loader- part of RM that loads systems programs and application
programs into memory when invoked by control card interpreter.

 RM has device drivers since Loader & Control card Interpreter


perform I/O. Device Driver is a subroutine (program) that defines
how an I/O device works describes how the buffers, flags,
registers, control bits, and status bits for a particular device should
be used.

 A Batch Operating system therefore reads a stream of separate


jobs (from a card reader), each with its own control cards that
predefine what the job does. Job output is printed on a line printer
(on-line processing).
 But there is lack of interaction between the user and the job
while that job is executing

Operating System Concepts


 Turn around time; the delay between Job submission and
job completion may result from amount of computing
needed, or from delays before the operating system
 There was still the problem of CPU speed being higher
than I/O devices (e.g. card readers, line printers) operation
speed. Thus CPU would still sit idle.

Operating System Concepts


Off-line Processing
 Solution to CPU sitting idle. Cards were first copied to a magnetic
tape via a separate device. When the tape was sufficiently full, it
was taken down & carried over to the computer. When a card
was needed for equivalent input to a program, the equivalent
record was read from the tape. Also output was written to tape
and contents of tape printed later.
 Card readers and line printers operated off-line, rather than the
main computer. Computer was now limited by speed of the
much faster tape.
 Longer delay in getting a particular job run, since it must first be
read onto tape to fill it. Tape must be rewound, unloaded, hand-
carried to the CPU & mounted onto a free tape drive (many
similar jobs can be batched onto a tape before taken to a
computer).

Operating System Concepts


Spooling
 Disk Systems with time, became available & improved on off-
line operation.
 The problem with tape systems was that the card reader could
not write onto one end of the tape, while the CPU read from
the other.
 The entire tape had to be written to before it is rewound and
read, because of tapes are Sequential Access devices by
nature.
 Disk Systems eliminated this since they are Random Access
devices. The head can move from one area of a disk to another-
therefore a disk can switch rapidly from the area on the disk
being used by the card reader to store new cards, to the
position needed by the CPU to read the next card.

Operating System Concepts


 During job execution;
 OS satisfies job requests for card reader input by reading
from the disk,
 If the job requests the printer to output a line, that line is
copied into system buffer & is written to disk.
 If job is completed, the output is actually printed. This form
of processing is called Spooling (Simultaneous Peripheral
Operation Online).
 Spooling uses the disk as a very large buffer, as far ahead as
possible on input devices & for storing output files till the
output devices are able to accept them.
 Spooling is used for processing data at remote sites: CPU sends
data via communication paths to a remote printer/ accepts an
entire input job from a remote card reader.

Operating System Concepts


In this; remote processing is done at its own speed
with no CPU intervention- then later CPU is notified of
completion so that it can spool the next batch of data.
Spooling overlaps I/O with computation of other jobs

Spooling

Operating System Concepts


Multi programmed Batch Systems
 Spooling provides a vital data structure called a job pool. Spooling
results in several jobs that have already been read waiting on disk,
ready to run.
 OS can then select which Job to run next- to increase CPU utilization
(jobs on card readers and tapes can’t be read in a different order-
must be run sequentially on FCFS basis).
 Disks enable Job scheduling: this enables multi-programming. In off-
line operation & spooling, a single user can not keep the CPU or I/O
devices busy at all times.
 Multi programming increases CPU utilization by organizing jobs so
that the CPU always has something to execute.
 OS keeps several jobs in main memory at the same time (this set of
jobs is a subset of the jobs kept in the job pool- since No. of jobs that
can be in memory is less than the No. of jobs that can be in a job
pool).

Operating System Concepts


Multi-programming Process in Batch Systems:
 OS picks & begins to execute one of the jobs in
memory; at any time, the job may have to wait for
some task (e.g tape to be mounted, command to be
typed on keyboard or I/O operation) to complete. This
makes CPU idle incase of non multi-programmed
system, otherwise the OS simply switches to &
executes another job; till first job finishes waiting and
gets the CPU back.
 OS keeps several jobs in main memory at the same
time, and the CPU is multiplexed among them.

Operating System Concepts


Multi programmed Batch Systems

Operating System Concepts


OS Features Needed for Multiprogramming
 I/O routine supplied by the system.
 Memory management – the system must allocate the memory
to several jobs.
 Job Scheduling-If several jobs are ready to be brought into
memory, & there is not enough room for all of them, then the
system must choose among them. (however all jobs entering
the system are kept in the job pool-which consists of all
processes residing on mass storage waiting allocation of main
memory)
 CPU scheduling – if several jobs are to run at the same time,
the system must choose among them.
 Allocation of devices.

Operating System Concepts


Difficulties with the Batch systems from the
programmers’ or users’ point of view;
 User can not interact with the job when executing, so
user had to set up control cards to handle all possible
outcomes.
 Batch systems required that programs must be
debugged statically from snapshot dumps. Therefore
programmers couldn’t modify a program as it
executes to study its behavior. The long turnaround
time held back experimentation with a program.

Operating System Concepts


Time-Sharing Systems–Interactive Computing
 The CPU is multiplexed/switched 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). Switches
occur so frequently that users may interact with each
program while it is running (also called multitasking).
 A job is swapped in and out of memory to the disk.
 Interactive/hands-on system, provides On-line
communication between the user and the system (give
instruction, get immediate response); when the
operating system finishes the execution of one
command, it seeks the next “control statement” from
the user’s keyboard (not the card reader).
 Systems have an interactive text editor for entering
programs & interactive debugger.

Operating System Concepts


 On-line file system must be available for users to
access data and code.
 Time-shared OS uses CPU scheduling and multi-
programming to provide @ user with a small portion
of a time-shared computer.
 Allows many users to share a computer
simultaneously since @ action/command in a time-
shared system tends to be short, therefore a short
CPU time is needed for each user. Switching gives
the user an impression that (s)he own their own
computer.
Multitasking vs Multiprogramming vs Time sharing
A clarification on these 3 notions is given below to
avoid intermixing.

Operating System Concepts


 Multitasking is a generic term allowing multiple tasks to be
run, without regard to timing.
 Multiprogramming is the possibility for multiple programs to
be ready, and waiting for the processor to be free. The initial
purpose of this was to allow a second program to run while the
first one waited for some I/O to complete. Multiprogramming
does not require any cooperation between programs, as there
were no interactive users anyway. If a program needed the CPU
for a long time, it could use it.
 Time sharing is a method where all ready tasks are given a fair
access to the CPU.

The goal of multiprogramming is to minimize idle time for the


processor, and that was the primary objective in the times the
processor time was expensive.

Operating System Concepts


Batch Vs Interactive
 Batch systems are appropriate for executing large jobs
that need little interaction (submit a job & come back
later for results); Whereas interactive has many short
actions & results of the next command may be
unpredictable.
 Response time in interactive is shorter.
 Time-sharing OS are more complex than
multiprogrammed OS. In Multiprogramming, several
jobs are kept simultaneously in memory-there is need
of memory management and protection.

Operating System Concepts


Desktop Systems
 Personal computers (PCs) – computer system dedicated to a
single user.
 I/O devices – keyboards, mice, display screens, small printers
etc replaced card readers and line printers.
 Smaller & less expensive than mainframe systems.
 Main goal of PC OS is User convenience and responsiveness
rather than CPU and peripheral utilization.
 Can adopt technology developed for larger operating system’
often individuals have sole use of computer and do not need
advanced CPU utilization of protection features.
 May run several different types of operating systems (MSDOS,
Windows, Apple MacOS, UNIX, Linux.

Operating System Concepts


Multi-Processor
Parallel Systems Systems
 Other than Single processor systems (systems with only one
main CPU) there is a new trend toward multiprocessor systems
(systems having more than on CPU in close communication).
 Tightly coupled system – systems that have more than one
processor in close communication, sharing the computer bus,
clock, memory and peripheral devices. communication usually
takes place through the shared memory.

Operating System Concepts


 Advantages of tightly coupled systems:
 Increased throughput: Increasing No. of processors gets
more work done in a shorter period of time. Speed up ratio
of n processors is not n but rather less; since when multiple
processors cooperate on a task, a certain amount of
overhead is incurred in keeping everything working
correctly, & contention for shared resources all lower the
expected gain.
 Economical; these systems save money compared to
several single systems. Sharing of peripheral devices,
cabinets, power supplies, disks.

Operating System Concepts


 Increased reliability; if a function is distributed properly
among several processors, then failure of one processor will
not halt the system but rather slow it down since other
processors have to share the work of the failed processor.
This arises the following terms;
 Graceful Degradation: the ability to continue providing
service proportional to the level of non failed hardware.
 fail-soft systems: systems designed for graceful
degradation (fault tolerant systems).
Continued operation in the presence of failures requires a
mechanism to allow the failure to be detected, diagnosed, &
corrected e.g Tandem systems with identical processors
where one is primary and the other a backup.

Operating System Concepts


Models used in Multiple-processor systems
Symmetric Multiprocessing Model (SMP)
 Each processor runs an identical copy of the operating system &
the copies communicate with each other as needed.
 Many processes (N processes if N CPUs exist) can run at once
without performance deterioration.
 Most modern operating systems support SMP
 Ex. Encore’s version of UNIX for Multimax computer.
Asymmetric Multiprocessing
 Each processor is assigned a specific task; master processor
schedules & allocates work to slave processors (Master- Slave
Relationship) or slave processors have predefined tasks.
 More common in extremely large systems, where the most time
consuming activities is processing I/O

Operating System Concepts


Symmetric Multiprocessing Architecture

The difference between symmetric and asymmetric


processing: asymmetric needs special hardware to
differentiate the multiple processors or software written
to allow only one master and multiple slaves. E.g.
Sun’s operating system version provides asymmetric
multiprocessing where as version 5 (Solaris 2) is
symmetric.

Operating System Concepts


Distributed
 Loosely Coupled Systems
systems (Distributed systems) – each
processor has its own local memory; processors
communicate with one another through various
communications lines, such as high-speed buses or
telephone lines.
 Processors vary in size & function (e.g
microprocessors, workstations, minicomputers, large
general purposes systems); also referred to as sites,
nodes, computers etc depending on the context in
which they are mentioned.
 Distribute the computation among several physical
processors.
Operating System Concepts
Advantages of distributed
 Resources Sharing; if sitessystems
are connected to one another, a
user at one site may be able to use the resources (like remote
printer, remote files) available at another.
 Computation speed up; a computation can be into sub-
computations that run concurrently. If a particular site is
currently overloaded with jobs, some of them may be moved to
other lightly loaded sites i.e. load sharing.
 Reliability; if one site fails, the remaining can potentially
continue operating/ the failure of one should not affect the
rest. Though if there is some small No. of machines with some
crucial function (e.g. character I/O or the file system), then
failure may effectively halt the whole system- but if there is
redundancy in the system (both hardware and data) then
system can continue with operation even if some sites have
failed.

Operating System Concepts


 Communication; programs that need to exchange
data with one another on one system- processes at
different sites can exchange information. Users may
initiate file transfers or communicate with one
another via electronic mail.
Note:
 Requires networking infrastructure.
 Local area networks (LAN) or Wide area networks
(WAN)
 Distributed systems may be either Client-Server or
Peer-to-Peer systems.

Operating System Concepts


General Structure of Client-Server
 In Client/Server systems, terminals connected to centralized
systems are now being supported by PCs
 Centralized systems thus work as server systems to satisfy
requests generated by client systems
 Compute Servers: provide an interface to which clients can
send requests to perform action, they execute the action and
send back results to clients
 File Servers: provides file system interface where clients can
create, update, read, and delete files.

Operating System Concepts


Clustered Systems
 Involves gathering together multiple CPUs to accomplish
computational work.
 Different from Parallel systems, in that, these involve two or
more individual systems coupled together.
 Clustered computers share storage and are closely linked via
LAN networking.
 Provides high availability: a layer of cluster software runs on
each cluster node. @ node monitors one or more of others
(over a LAN). If the monitored part fails, the monitoring
machine can take ownership of its storage, and restart the
application(s) that were running on the failed node. Failed
node remains down but users & clients of application(s) only
see a brief interruption in service.

Operating System Concepts


Asymmetric clustering:
 One machine is in hot standby mode, while other is running the
applications. The hot standby host only monitors the active
server- so when the server fails, hot standby host becomes the
active server.
Symmetric clustering:
 Two or more hosts are running applications, and they are
monitoring each other.
 This mode is more efficient since it uses all the available
hardware.

Operating System Concepts


Real-Time
 Have well-defined fixed-timeSystems
constraints on the
operation of the processor or the flow of data/ the
system will fail.
 Often used as a control device in a dedicated
application such as controlling scientific experiments,
medical imaging systems, industrial control systems,
automobile engine fuel injection systems, home
appliance controllers, weapon systems, and some
display systems.
 Real-Time systems may be either hard or soft real-
time.

Operating System Concepts


Hard Real-time:
 Guarantees that critical tasks complete on time.
 All delays in the system be bounded, from the retrieval of
stored data to the time it takes the OS to finish any request
made of it.
 Secondary storage of any sort is limited or absent, & thus data
is stored in short term memory, or read-only memory (ROM-
which is nonvolatile).
 Advanced OS features like Virtual memory are avoided since
they tend to separate user further from hardware- which
further results in uncertainty in the amount of time an
operation will take.
 Hard real-time systems conflict with time-sharing systems, &
none of the general-purpose operating systems support hard
real-time functionality.

Operating System Concepts


Soft Real-time:
 A critical real-time task gets priority over other tasks,
and retains that priority until it completes.
 Kernel delays still need to be bound. A real time task
cannot be kept waiting indefinitely for the kernel to
run it.
 Soft Real-time systems have more limited utility than
hard real-time systems therefore can’t be used in
industrial control of robotics.
 Useful in applications (multimedia, virtual reality)
requiring advanced operating-system features.

Operating System Concepts


These Include; Handheld Systems
 Personal Digital Assistants (PDAs) e.g. palm pilots, cellular
telephones
 Issues:
 Limited memory; i.e. btn 512KB and 8MB.this is due to
limited size-most devices are 5 Inches by 3 Inches.
 Slow processors; processors run at a fraction of the
speed of a PC processor. Faster processors require more
power. Thus a handheld device would need a large
battery that requires to be replaced/recharged
frequently. For portability of handheld devices, small-
slower processors which consume less power are used.

Operating System Concepts


 Small display screen; 3 inches compared to 21 inches of a
PC. Tasks have to be condensed to smaller displays. Web
clipping is used where only a small subset of a web page
is delivered and displayed on a hand held device.
 Some use wireless technology like BlueTooth to allow
remote access to email and web technology e.g cellular
phones with internet connectivity.

This implies that to understand modern OSs, the theme of


feature migration and recognition of the long history of many
OS features, is vital. For example MULTICS (MULTIplexed
Information and Computing Services) which was originally
developed and a computing utility.

Operating System Concepts


Migration of Operating-System Concepts and Features

Operating System Concepts


How canComputing Environments
such systems (hands on, Multi-
programmed, time shared, hand held) be used in a
variety of computing env’t settings?
Traditional Computing:
 Considering the “typical office env’t” which originally composed of
PCs connected to a network with servers providing file and print
service.
 Remote access was awkward & portability achieved by use of
laptops.
 Web technologies are stretching the boundaries of traditional
computing. Companies are implementing portals which provide
web accessibility to their internals servers.
 Hand held devices synchronize with PCs, wireless networks, low
cost network connections.
Operating System Concepts
FYI: A web portal is a web site that provides a
starting point, a gateway, or portal, to other
resources on the Internet or an intranet.
Intranet portals are also known as "Enterprise
Information Portals" (EIP).
Web-Based Computing:
 PCs are still the most prevalent access devices, with workstations
(high-end graphic oriented PCs), handheld PDAs, and even cell
phones all providing access.
 Wired and Wireless access devices.
 Faster network connectivity due to improved networking
technology, optimized network implementation code, or both.
 Introduced Load Balancers: these distribute network connections
among a pool of servers. Web client OSs like windows 95 have
evolved into Web Servers as well as clients like Windows ME,
Windows 2000.
Operating System Concepts
Embedded Computing:
 These are the most common form of computers- they run
real-time operating systems.
 Devices include; car engines, manufacturing robots, VCRs,
microwave ovens etc.
 Device with specific tasks. Systems are primitive, lacking
advanced features like Virtual Memory, disks.
 They have little or no user interface.

Operating System Concepts

You might also like