0% found this document useful (0 votes)
35 views39 pages

Chapter 1 Introduction

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

Chapter 1 Introduction

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

Chapter 1: Introduction

•Operating System Concepts – 9th •Silberschatz, Galvin and Gagne ©2013


Contents

●What Operating Systems Do


 Computer-System Organization
 Computer-System Architecture
 Operating-System Structure
 Operating-System Operations
 Computing Environments
 Open-Source Operating Systems

•Operating System Concepts – 9th •1.2 •Silberschatz, Galvin and Gagne ©2013
Objectives

●To describe the basic organization of computer


systems

●To provide a grand tour of the major components


of operating systems

●To give an overview of the many types of


computing environments

●To explore open-source operating systems

•Operating System Concepts – 9th •1.3 •Silberschatz, Galvin and Gagne ©2013
What is an Operating System?

●A program that acts as an intermediary


between a user of a computer and the computer
hardware

•Operating System Concepts – 9th •1.4 •Silberschatz, Galvin and Gagne ©2013
What is an Operating System?

●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 Os: “W it hout me,
st in a
you'd be lo 0s!”
and
sea of 1s

•Operating System Concepts – 9th •1.5 •Silberschatz, Galvin and Gagne ©2013
Why should we learn OS as a student?

Understanding how it works provides insight into


how computers operate at a fundamental level.
Seeing Behind the Scenes
Learning about operating systems helps
students understand how to write efficient code
that interacts well with the OS, leading to better
performance and resource utilization.

•Operating System Concepts – 9th •1.6 •Silberschatz, Galvin and Gagne ©2013
Computer System Structure
●Computer system can be divided into four components:
1) Hardware – provides basic computing resources
CPU, memory, I/O devices

2) Operating system
Controls and coordinates use of hardware among
various applications and users

3) Application programs – define the ways in which the


system resources are used to solve the computing
problems of the users
 Word processors, compilers, web browsers, database
systems, video games
4) Users
People, machines, other computers
•Operating System Concepts – 9th •1.7 •Silberschatz, Galvin and Gagne ©2013
Client

Client
Client

Client

Server Client

Client Client
Client

•Operating System Concepts – 9th •1.8 •Silberschatz, Galvin and Gagne ©2013
Four Components of a Computer System

•Operating System Concepts – 9th •1.9 •Silberschatz, Galvin and Gagne ©2013
What Operating Systems Do

1) Depends on the point of view


● Users want convenience, ease of use

● Don’t care about resource utilization

2) But shared computer such as mainframe or


minicomputer must keep all users happy
3) Users of dedicate systems such as workstations have
dedicated resources but frequently use shared resources
from servers
4) Handheld computers are resource poor, optimized for
usability and battery life
● Some computers have little or no user interface, such as

embedded computers in devices and automobiles

•Operating System Concepts – 9th •1.10 •Silberschatz, Galvin and Gagne ©2013
Operating System Definition

●OS is a resource allocator


●Manages all resources
●Decides between conflicting requests for efficient
and fair resource use

●OS is a control program


●Controls execution of programs to prevent errors
and improper use of the computer

•Operating System Concepts – 9th •1.11 •Silberschatz, Galvin and Gagne ©2013
Operating System Definition (Cont.)

●No universally accepted definition

●“Everything a vendor ships when you order


an operating system” is good approximation
●But varies wildly

●“The one program running at all times on the


computer” is the kernel. Everything else is
either a system program (ships with the
operating system) or an application program.

•Operating System Concepts – 9th •1.12 •Silberschatz, Galvin and Gagne ©2013
Computer Startup

●bootstrap program is loaded at power-up or reboot


●Typically stored in ROM or EPROM, generally known
as firmware
●Initializes all aspects of system
●Loads operating system kernel and starts execution

•Operating System Concepts – 9th •1.13 •Silberschatz, Galvin and Gagne ©2013
Computer System Organization

●Computer-system operation
●One or more CPUs, device controllers connect through
common bus providing access to shared memory
●Concurrent execution of CPUs and devices competing for
memory cycles

•Operating System Concepts – 9th •1.14 •Silberschatz, Galvin and Gagne ©2013
Computer-System Operation


I/O devices and the CPU can execute concurrently


Each device controller is in charge of a particular
device type


Each device controller has a local buffer


CPU moves data from/to main memory to/from local
buffers


I/O is from the device to local buffer of controller


Device controller informs CPU that it has finished its
operation by causing an interrupt
•Operating System Concepts – 9th •1.15 •Silberschatz, Galvin and Gagne ©2013
Common Functions of Interrupts

●Interrupt transfers control to the interrupt service


routine generally, through the interrupt vector, which
contains the addresses of all the service routines

●Interrupt architecture must save the address of the


interrupted instruction

●A trap or exception is a software-generated interrupt


caused either by an error or a user request

●An operating system is interrupt driven

Interrupt Service Routine. It's a specialized function within an operating system that gets
triggered in response to an interrupt.

•Operating System Concepts – 9th •1.16 •Silberschatz, Galvin and Gagne ©2013
Interrupt Handling

●The operating system preserves the state of the CPU


by storing registers and the program counter

●Determines which type of interrupt has occurred:


●polling
●vectored interrupt system

●Separate segments of code determine what action


should be taken for each type of interrupt

•Operating System Concepts – 9th •1.17 •Silberschatz, Galvin and Gagne ©2013
Direct Memory Access Structure

●Used for high-speed I/O devices able to transmit


information at close to memory speeds

●Device controller transfers blocks of data from buffer


storage directly to main memory without CPU
intervention

●Only one interrupt is generated per block, rather than


the one interrupt per byte

•Operating System Concepts – 9th •1.18 •Silberschatz, Galvin and Gagne ©2013
How a Modern Computer Works

•A von Neumann architecture

•Operating System Concepts – 9th •1.19 •Silberschatz, Galvin and Gagne ©2013
Batch operating system

A batch operating system (BOS) is a computer


system that executes similar Jobs in groups, also
known as batches without direct user interaction.
The users of 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. Thus, the programmers left their programs with the operator.
The operator then sorts programs into batches with similar requirements.

The problems with Batch Systems are following.


 Lack of interaction between the user and job.
 CPU is often idle, because the speeds of the mechanical I/O
devices are slower than CPU.
 Difficult to provide the desired priority.

•Operating System Concepts – 9th •1.20 •Silberschatz, Galvin and Gagne ©2013
•Operating System Concepts – 9th •1.21 •Silberschatz, Galvin and Gagne ©2013
Batch Operating System

How does it work?


2. Batch
1.
3. Operator
Jobs are creates batches
submitted
is given input bythe
to of
users similar
to the operator
system
jobs
Use Batch 1
Job s
r1
1 Job

Job 2 Operator Computer


Use
r2

Jo
bs
3
Job
Use Batch 2
r3

•Operating System Concepts – 9th •1.22 •Silberschatz, Galvin and Gagne ©2013
Operating System Structure

●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
●It is preemptive

A multiprogramming
operating system is a
type of operating
system that allows Memory Layout for
multiple programs to Multiprogrammed System
run simultaneously on
a single CPU.

•Operating System Concepts – 9th •1.23 •Silberschatz, Galvin and Gagne ©2013
Working of Multiprogrammed System

Main Memory
Process 1
Process 2
Process 3 CPU
Operating System

•Operating System Concepts – 9th •1.24 •Silberschatz, Galvin and Gagne ©2013
Operating System Structure
●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
Processor's time which is shared among multiple users simultaneously is
termed as time-sharing.
●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

Process time
Time Quanta = 2
P1 2
P1 P2 P3
P2 3 P1

0 2 4 6
P3 2 7
CPU time

•Operating System Concepts – 9th •1.25 •Silberschatz, Galvin and Gagne ©2013
The main difference between Multiprogrammed Batch
Systems and Time-Sharing Systems is that in case of
multiprogrammed systems, objective is to maximize
processor use, whereas in Time-Sharing Systems objective is
to minimize response time.

•Operating System Concepts – 9th •1.26 •Silberschatz, Galvin and Gagne ©2013
Operating-System Operations
●Interrupt driven by hardware
●Software error or request creates exception or trap
●Division by zero, request for operating system service

●Other process problems include infinite loop, processes modifying each


other or the operating system

●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
or kernel code
Some instructions designated as privileged, only executable in
kernel mode (bit = 0)
System call changes mode to kernel, return from call resets it to
user
In special mode, the VMM has more
privileges than user processes but fewer than the kernel. It needs that level
of privilege so it can create and manage virtual machines, changing the CPU
state to do so.

•Operating System Concepts – 9th •1.27 •Silberschatz, Galvin and Gagne ©2013
Transition from User to Kernel Mode

System calls provide the means for a user program to ask the operating system to perform tasks
reserved for the operating system on the user program’s behalf.

●Timer to prevent infinite loop / process hogging resources


●Set interrupt after specific period
●Operating system decrements counter
●When counter zero generate an interrupt
●Set up before scheduling process to regain control or
terminate program that exceeds allotted time

•Operating System Concepts – 9th •1.28 •Silberschatz, Galvin and Gagne ©2013
Virtualization

●Virtualization allows operating systems (OS) to run as applications within


other OSs, enabling multiple OS instances on a single physical machine.
●Emulation is related but distinct, as it allows software written for one
CPU architecture to run on another, often with a performance cost. (eg.
running console games on pc)
●VMware allows multiple OSs (like Windows and Linux) to run on a single
host OS, such as Windows XP. Eg. Virtual Box

•Operating System Concepts – 9th •1.29 •Silberschatz, Galvin and Gagne ©2013
Computing Environments – Cloud Computing

Cloud computing is the delivery of computing services—including servers,


storage, databases, networking, software, analytics, and intelligence—over the
Internet

●Delivers computing, storage, even apps as a service across a network


●Logical extension of virtualization as based on virtualization
●Amazon EC2 has thousands of servers, millions of VMs, PBs of
storage available across the Internet, pay based on usage
●Many types
●Public cloud – available via Internet to anyone willing to pay
●Private cloud – run by a company for the company’s own use
●Hybrid cloud – includes both public and private cloud components

•Operating System Concepts – 9th •1.30 •Silberschatz, Galvin and Gagne ©2013
Computing Environments – Cloud Computing

●Software as a Service (SaaS) – SaaS provides users with access to


software applications over the Internet, typically through a web
browser, without the need for local installation or maintenance.
Google Docs is a popular SaaS product. Users can create, edit, and
share documents online without needing to install

●Platform as a Service (PaaS) – PaaS offers a platform that allows


developers to build, run, and manage applications without worrying
about the underlying infrastructure. It includes everything from
servers to storage, networking, and even development tools. Heroku
is a well-known PaaS that allows developers to deploy and manage
applications. Another example would be Azure SQL Database

●Infrastructure as a Service (IaaS) – IaaS provides virtualized


computing resources over the Internet, including servers, storage,
and networking hardware. Users can rent these resources on-
demand and scale them as needed. (i.e. storage available for backup
use) Amazon Web Services (AWS) EC2 is a prime example of IaaS.
•Operating System Concepts – 9th •1.31 •Silberschatz, Galvin and Gagne ©2013
Computing Environments – Cloud Computing

●Cloud compute environments composed of traditional OSes, plus VMMs,


plus cloud management tools
●Internet connectivity requires security like firewalls
●Load balancers spread traffic across multiple applications

•Operating System Concepts – 9th •1.32 •Silberschatz, Galvin and Gagne ©2013
Computing Environments – Real-Time Embedded Systems

●Real-time embedded systems most prevalent form of computers


●Vary considerable, special purpose, limited purpose OS, real-time OS
●Use expanding
●Many other special computing environments as well
●Some have OSes, some perform tasks without an OS
●Real-time OS has well-defined fixed time constraints
●Processing must be done within constraint
●Correct operation only if constraints met
●For example Scientific experiments, medical imaging systems,
●industrial control systems, weapon systems, robots, and home-appliance
controllers, Air traffic
●control system etc.

•Operating System Concepts – 9th •1.33 •Silberschatz, Galvin and Gagne ©2013
Computing Environments – Real-Time Embedded Systems

There are two types of real-time systems.

Hard real-time systems


Hard real-time systems guarantee that critical tasks complete on time. In hard
real-time systems secondary storage is limited or missing with data stored in ROM.
In these systems virtual memory is almost never found.
Airbag Deployment System in Cars – In this system, sensors detect a collision, and
the airbag must deploy within milliseconds to protect the passengers. If the system
fails to deploy the airbag on time, it can result in severe injury or death. Therefore,
the software cont

Soft real-time systems


Soft real time systems are less restrictive. Critical real-time task gets priority over
other tasks and retains the priority until it completes. Soft real-time systems have
limited utility than hard real-time systems. For example,
Multimedia, virtual reality, Advanced Scientific Projects like
undersea exploration and planetary rovers etc.
Multimedia Streaming – When watching a video online, the system strives to
provide smooth playback. If there's a slight delay in buffering or processing, the
video may pause briefly, but the impact is usually minor and the system can recover.

•Operating System Concepts – 9th •1.34 •Silberschatz, Galvin and Gagne ©2013
Distributed operating System
Distributed systems use multiple central processors
to serve multiple real time application and
multiple users. Data processing jobs are distributed
among the processors accordingly to which
one can perform each job most efficiently.

•Operating System Concepts – 9th •1.35 •Silberschatz, Galvin and Gagne ©2013
Distributed operating System

The advantages of distributed systems are following.


 With resource sharing facility user at one site may be able to
use the resources available at another.
 Speedup the exchange of data with one another via
electronic mail.
 If one site fails in a distributed system, the remaining sites
can
potentially continue operating. (Fault Tolerance)
 Better service to the customers.
 Reduction of the load on the host computer.
 Reduction of delays in data processing.

•Operating System Concepts – 9th •1.36 •Silberschatz, Galvin and Gagne ©2013
Network operating System

Network Operating System runs on a server and and provides server the capability
to manage data, users, groups, security, applications, and other networking
functions.
The primary purpose of the network operating system is to allow shared file
and printer access among multiple computers in a network, typically a local area
network (LAN), a private network or to other networks. Examples of network
operating systems are Microsoft Windows Server 2003, Microsoft Windows Server
2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD.

•Operating System Concepts – 9th •1.37 •Silberschatz, Galvin and Gagne ©2013
Open-Source Operating Systems

●Operating systems made available in source-code format rather than


just binary closed-source

●Counter to the copy protection and Digital Rights Management


(DRM) movement

●Started by Free Software Foundation (FSF), which has “copyleft” GNU


Public License (GPL)

●Examples include GNU/Linux and BSD UNIX (including core of Mac


OS X), and many more
●Can use VMM like VMware Player (Free on Windows), Virtualbox (open
source and free on many platforms - http://www.virtualbox.com)
●Use to run guest operating systems for exploration

•Operating System Concepts – 9th •1.38 •Silberschatz, Galvin and Gagne ©2013
End of Chapter 1

•Operating System Concepts – 9th •Silberschatz, Galvin and Gagne ©2013

You might also like