0% found this document useful (0 votes)
7 views32 pages

CH 1

Uploaded by

Arifur Rahaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views32 pages

CH 1

Uploaded by

Arifur Rahaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 32

Module 1: Introduction

• What is an operating system?


• Simple Batch Systems
• Multiprogramming Batched Systems
• Time-Sharing Systems
• Personal-Computer Systems
• Parallel Systems
• Distributed Systems
• Real -Time Systems

Operating System Concepts 1.1 Silberschatz and Galvin 1999


What is an Operating System?

• A program that manages the computer hardware and acts as an


intermediary between a user of a computer and the computer
hardware.
• Operating system goals:
– Execute user programs and make solving user problems
easier.
– Make the computer system convenient to use.
• Use the computer hardware in an efficient manner.

Operating System Concepts 1.2 Silberschatz and Galvin 1999


Computer System Components

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 (people, machines, other computers).

Operating System Concepts 1.3 Silberschatz and Galvin 1999


Abstract View of System Components

Operating System Concepts 1.4 Silberschatz and Galvin 1999


Types of Operating System

• Batch Operating System


• Time sharing Operating System
• Distributed Operating System
• Network Operating System
• Real Time Operating System

Operating System Concepts 1.5 Silberschatz and Galvin 1999


Batch Operating System

• The users of a batch operating system do not interact with the


computer directly.
• Each user prepares his job on an off-line device like punch cards
and submits it to the computer operator.
• To speed up processing, jobs with similar needs are batched
together and run as a group.
The Problems with Batch system are as follows:
Lack of interaction between the user and the job.
CPU is often idle, because the speed of the mechanical I/O
devices is slower than the CPU.
Difficult to provide the desired priority.

Operating System Concepts 1.6 Silberschatz and Galvin 1999


Time-sharing operating systems

• Time-sharing is a technique which enables many people, located


at various terminals, to use a particular computer system at the
same time.
• Time-sharing or multitasking is a logical extension of
multiprogramming.
• Processor's time which is shared among multiple users
simultaneously is termed as time-sharing.

Operating System Concepts 1.7 Silberschatz and Galvin 1999


Time-sharing operating systems

• The main difference between Multiprogrammed Batch Systems


and Time-Sharing Systems is that in case of Multiprogrammed
batch systems, the objective is to maximize processor use,
whereas in Time-Sharing Systems, the objective is to minimize
response time.

Operating System Concepts 1.8 Silberschatz and Galvin 1999


OS from User View

 The user view of the computer varies by the interface being


used.
For the users of personal computer, the operating system is
designed mostly for ease of user, with some attention paid to
performance and none paid to resource utilization. In this
case performance is important to the user but it does not matter
if most of the system is sitting idle, waiting for the slow I/O speed
of the user.
 The users that are connected to mainframe or mini computer,
share resources and may exchange information. For them the
OS is designed to maximize resource utilization----to assure
that all available CPU time, memory and I/O are used efficiently
and that no individual user takes more than her fair share.

Operating System Concepts 1.9 Silberschatz and Galvin 1999


Continue….

 The users who sit at workstations, connected to network of


other workstations and servers, have dedicated resources at their
disposal but they also share resources such as networking and
servers---file, print server etc. Therefore, their operating system
is designed to compromise between individual usability and
resource utilization.

Operating System Concepts 1.10 Silberschatz and Galvin 1999


Operating System from System View

• From the computer’s point of view, the operating system is the


program that is most intimate with the hardware. We can view
OS as:
Resource allocator – manages and allocates resources.
Control program – controls the execution of user programs and
operations of I/O devices .
Kernel – the one program running at all times (all else being
application programs).

Operating System Concepts 1.11 Silberschatz and Galvin 1999


Multiprogramming

• Figure 1-4. A multiprogramming system


• with three jobs in memory.

1.12
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Silberschatz and Galvin 1999
Continue…

• All the jobs that enter to the system are kept in the job pool. This
pool consists of the processes residing on the disk, awaiting
allocation of main memory.
• If several jobs are ready to be brought into memory and if there is
not enough room for all of them, then the system must choose
among them. Making this decision is job scheduling.
• If several jobs are ready to run at the same time, the system
must choose among them. Making this decision is CPU
Scheduling.

Operating System Concepts 1.13 Silberschatz and Galvin 1999


Continue…

• Another major feature present in third-generation operating


system was the ability to read jobs from cards onto the disk as
soon as they were brought to the computer room. Then,
whenever a running job finished, the operating system could load
a new job from the disk into the now-empty partition and run it.
This technique is called “spooling”.
• Although third-generation operating systems were well-suited for
big scientific calculation and massive commercial data
processing runs, they were still basically batch system.
• With third-generation systems, the time between submitting a job
and getting back the output was often several hours, so a single
placed comma could cause a compilation to fail and the
programmer to waste half a day.

Operating System Concepts 1.14 Silberschatz and Galvin 1999


Continue…

• This desire for quick response time paved the way for
timesharing , a variant of multiprogramming where each user
has an on-line terminal.
• Since people debugging programs usually issue short commands
rather than long ones, the computer can provide fast, interactive
service to a number of users and perhaps also work on big batch
jobs in the background when the CPU is otherwise idle.

Operating System Concepts 1.15 Silberschatz and Galvin 1999


• Timesharing (multitasking) is logical extension in which CPU switches
jobs so frequently that users can interact with each job while it is running,
creating interactive computing
– Response time should be < 1 second
– Each user has at least one program executing in memory process
– If several jobs ready to run at the same time  CPU scheduling
– If processes don’t fit in memory, swapping moves them in and out
to run
– Virtual memory allows execution of processes not completely in
memory

Operating System Concepts 1.16 Silberschatz and Galvin 1999


Compute System Architecture

• Single processor System


• Multiprocessor system
• Clustered system
• Real time system
• Handheld system

Operating System Concepts 1.17 Silberschatz and Galvin 1999


Parallel Systems

• Multiprocessor systems with more than one CPU in close


communication.
• Tightly coupled system – processors share memory and a clock;
communication usually takes place through the shared bus.
• Advantages of parallel system:
– Increased throughput
– Economical
– Increased reliability
 graceful degradation
 Fault tolerant systems

Operating System Concepts 1.18 Silberschatz and Galvin 1999


Continue…

• Continue operation in the presence of failure requires a mechanism to


allow the failure to be detected, diagnosed and if possible, corrected.
• The system uses both hardware and software duplication to ensure
continued operations despite failure.
• The system consists of two identical processors, each with its own local
memory.
• The processors are connected by bus. One processor is the primary and
the other is the back up.
• Two copies are kept in each processors.
• At fixed check point of execution of the system, the state of information of
each job---including the copy of memory image is copied from primary to
back up processor.
• If any failure detected, the back up copy is activated and restarted from
the most recent check out point.

Operating System Concepts 1.19 Silberschatz and Galvin 1999


Parallel Systems (Cont.)

• Symmetric multiprocessing (SMP)


– Each processor runs an identical copy of the operating
system and these copies communicate with one another as
needed.
– Many processes can run at once without performance
deterioration.
– All processors are peers; no master-slave relationship exists
between processors.
– Most modern operating systems support SMP
• Asymmetric multiprocessing
– Each processor is assigned a specific task; master
processor schedules and allocates work to slave processors.
– More common in extremely large systems

Operating System Concepts 1.20 Silberschatz and Galvin 1999


Symmetric Multiprocessing Architecture

Operating System Concepts 1.21 Silberschatz and Galvin 1999


Clustered System

• Gathers together multiple CPUs to accomplish computational


work.
• They are different from parallel system in that they are composed
of two or more individual systems coupled together.
• Clustering is usually performed to provide high availability.
• A layer of cluster software runs on the cluster nodes, each node
can monitor one or more of the others (over the LAN).
• If the monitored machine fails, the monitoring machine can take
ownership of its storage and restart the application that was
running on the failed machine.
• The failed machine may remain down but the users and clients of
the application would only see a brief interruption of service

Operating System Concepts 1.22 Silberschatz and Galvin 1999


Real-Time Systems

• Usually used by embedded system


• Often used as a control device in a dedicated application such as
controlling scientific experiments, medical imaging systems,
industrial control systems, and some display systems.
• Well-defined fixed-time constraints. Processing must be done
within the defined constraints or the system will fail.
• A real time systems function correctly only if it returns the correct
result within its time constraints.

Operating System Concepts 1.23 Silberschatz and Galvin 1999


Operating-System Operations

• Modern operating systems are interrupt driven.


• Events are almost always signaled by the occurrence of an interrupt or a
trap.
• A trap is a software-generated interrupt caused either by an error or by a
specific request from a user program that an operating system service be
performed.
– Division by zero, request for operating system service
• Since the operating system and the users share the hardware and
software resources of the computer system, we need to make sure that
an error in a user program could cause problems only for the one
program that was running.
• More subtle errors can occur in a multiprogramming system, where one
erroneous program might modify another program, the data of another
program or even the operating system itself.
• A properly designed OS must ensure that an incorrect program cannot
cause other programs to execute incorrectly.

1.24 Silberschatz and Galvin 1999


Duel-Mode Operation

• Dual-mode operation allows OS to protect itself and other


system components
– User mode and kernel mode
– Mode bit provided by hardware
 Provides ability to distinguish when system is running
user code (mode1) or kernel code (mode 0)
 When the computer system is executing on behalf of a
user application, the system is in user mode.
 When a user application request a service from the
operating system (via a system call), it must transition
from user to kernel mode to fulfill the request.
 Some instructions designated as privileged, only
executable in kernel mode. If an attempt is made to
execute a privileged instruction in user mode, the
hardware treats is as illegal and traps it to the OS.

Operating System Concepts 1.25 Silberschatz and Galvin 1999


Continue…

• At system boot time the hardware starts in kernel mode.


• The OS is then loaded and starts user applications in user mode.
• Whenever a trap or interrupt occurs, the hardware switches from
user mode to kernel mode.
• Whenever the OS gains control of the computer, it is in kernel
mode.
• The system always switches to user mode (by setting the mode
bit to 1) before passing control to a user program.
• Eventually, control is switched back to the operating system via
an interrupt, a trap or a system call.

Operating System Concepts 1.26 Silberschatz and Galvin 1999


Transition from User to Kernel Mode

• The lack of a hardware supported mode can cause serious


shortcoming in an operating system.
• MS-DOS was written for the Intel 8088 architecture, which has no
mode bit and therefore a user program running away can wipe
out the operating system by writing over it with data.

1.27 Silberschatz and Galvin 1999


Timer

• We must prevent a user program from getting stuck in an infinite loop


or not calling system services and never returning control to the OS.
• We can user a Timer.
• Timer to prevent infinite loop / process hogging resources
– Set interrupt after specific period (may be fixed or variable)
– A variable-timer is generally implemented by a fixed-rate clock
and a counter.
– The OS sets the counter.
– Operating system decrements counter everytime the clock ticks.
– When counter reaches to zero, it generates an interrupt
– Before turning control to the user, the OS ensures that the timer
is set to interrupt.

Operating System Concepts 1.28 Silberschatz and Galvin 1999


Computing Environments (Cont.)

 Client-Server Computing
 Dumb terminals supplanted by smart PCs
 Many systems now servers, responding to requests generated by
clients
 Compute-server provides an interface to client to request
services (i.e. database)
 File-server provides interface for clients to store and retrieve
files

1.29 Silberschatz and Galvin 1999


Peer-to-Peer Computing

• Another model of distributed system


• P2P does not distinguish clients and servers
– Instead all nodes are considered peers
– May each act as client, server or both
– Node must join P2P network
 Registers its service with central lookup service on
network. Any node desiring a specific service first
contacts this centralized lookup service to determine
which node provides the service.

or
 Broadcast request for service and respond to requests for
service via discovery protocol
– Examples include Napster and Gnutella

1.30 Silberschatz and Galvin 1999


Web-Based Computing

• Web has become ubiquitous, leading to more access by a wider


variety of devices than was dreamt of a few years ago.
• PCs most prevalent devices
• More devices becoming networked to allow web access
• New category of devices to manage web traffic among similar
servers: load balancers
• Use of operating systems like Windows 95, client-side, have
evolved into Linux and Windows XP, which can be clients and
servers

1.31 Silberschatz and Galvin 1999


End of Chapter 1

1.32 Silberschatz and Galvin 1999

You might also like