Chap1 Introduction 2021 in

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Chapter 1: Introduction

Operating Systems 1. What Operating Systems Do


2. Computer-System Organization
Chapter 1 3. Computer-System Architecture
Introduction 4. Operating-System Structure
5. Operating-System Operations
LECTURER: LAM NHUT KHANG 6. Computing Environments
Slides are either from or adapted from 7. History of Operating Systems
Operating System Concepts 10th Ed. Silberschatz, Galvin, Gagne, 2018.

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,


CTU_LNK 2
GAGNE©2018

Computer System Structure


Four components of a Computer System

What Operating
systems do

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 3 CTU_LNK 4
GALVIN, GAGNE©2018 GAGNE©2018
What is an Operating System? Operating System Goals
A program that acts as an intermediary between a user of a Execute user programs and make solving user problems easier
computer and the computer hardware

Make the computer system convenient to use

Use the computer hardware in an efficient manner

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 5 CTU_LNK 6
GAGNE©2018 GAGNE©2018

What Operating Systems Do Operating System Definition


Depends on the point of view OS is a resource allocator
Manages all resources
Users want convenience, ease of use
Decides between conflicting requests for efficient and fair resource use
resource utilization
Each program gets time with the resource, e.g., CPU
But shared computer such as mainframe or minicomputer must Each program gets space on the resource, e.g., MEM
keep all users happy
OS is a control program
Users of dedicated systems such as workstations have dedicated Controls execution of programs to prevent errors and improper use of the
resources but frequently use shared resources from servers computer
Handheld computers are resource poor, optimized for usability and OS is an extended machine
battery life Hides the messy details which must be performed
Presents user with a virtual machine, easier to use
Some computers have little or no user interface, such as embedded
computers in devices and automobiles Protection domain

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 7 CTU_LNK 8
GAGNE©2018 GAGNE©2018
Operating System Definition
(Cont.)
No universally accepted definition

Computer system
But varies wildly organization
kernel. Everything else is either a system program (ships with
the operating system) or an application program.

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ,
CTU_LNK 9 CTU_LNK 10
GAGNE©2018 GALVIN, GAGNE©2018

How does an Operating System


work? Computer Startup
Dual mode operation bootstrap program is loaded at power-up or reboot
User mode (application) Typically stored in ROM or EPROM, generally known as
Kernel mode (OS kernel) firmware
Initializes all aspects of system
Transition between user/kernel mode Loads operating system kernel and starts execution
interrupt HW device requests OS services
trap user program requests OS services
exception error handling

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 11 CTU_LNK 12
GAGNE©2018 GAGNE©2018
Computer System Operation
Computer System operation (cont.)
One or more CPUs, device controllers connect through I/O devices and the CPU can execute concurrently
common bus providing access to shared memory
Each device controller is in charge of a particular device type
Concurrent execution of CPUs and devices competing for
memory cycles 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
ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 13 CTU_LNK 14
GAGNE©2018 GAGNE©2018

Common Functions of Interrupts Interrupt Handling


Interrupt transfers control to the interrupt service routine generally, The operating system preserves the state of the CPU by
through the interrupt vector, which contains the addresses of all the
service routines storing registers and the program counter

Interrupt architecture must save the address of the interrupted instruction


Determines which type of interrupt has occurred:
Incoming interrupts are disabled while another interrupt is being polling
processed to prevent a lost interrupt
vectored interrupt system
A trap is a software-generated interrupt caused either by an error or a
user request
Separate segments of code determine what action should be
An operating system is interrupt driven taken for each type of interrupt

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 15 CTU_LNK 16
GAGNE©2018 GAGNE©2018
Storage-Device Hierarchy

Computer system
architecture

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ,
CTU_LNK 17 CTU_LNK 18
GAGNE©2018 GALVIN, GAGNE©2018

Computer System Architecture Single Processor Systems

Single processor systems Most systems use a single general-purpose processor (PDAs
through mainframes)

Multiprocessor systems
There is one main CPU capable of executing a general-purpose
instruction set
Clustered systems

Most systems have special-purpose processors as well

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 19 CTU_LNK 20
GAGNE©2018 GAGNE©2018
Multiprocessor Systems Multiprocessor Systems (cont.)
Multiprocessors systems growing in use and importance AMP vs. SMP
Also known as parallel systems, tightly-coupled systems AMP
Advantages include: Each processor is assigned a specific task
1. Increased throughput A boss processor controls the systems, schedules and allocates
2. Economy of scale work to the work processors
3. Increased reliability graceful degradation or fault The other processors look to the boss for instruction or have
predefined tasks
tolerance
SMP
Two types:
Each processor performs all tasks within the OS
1. Asymmetric MultiProcessing (AMP)
No boss-worker relationship
2. Symmetric MultiProcessing (SMP)
All processors share physical memory
ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 21 CTU_LNK 22
GAGNE©2018 GAGNE©2018

Multiprocessor Systems (cont.) Multiprocessor Systems (cont.)


A recent trend in CPU design is to include multiple computing
Symmetric Multiprocessing Architecture cores on a single chip multicore
Multicore can be more efficient than multiple chips with single
cores. Why?
While multicore systems are multiprocessor systems, not all
multiprocessor systems are multicore

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 23 CTU_LNK 24
GAGNE©2018 GAGNE©2018
Multiprocessor Systems (cont.) Clustered Systems
A Dual-Core Design with 2 cores on the same chip Like multiprocessor systems, but multiple systems working
together
Usually sharing storage via a storage-area network (SAN)
Provides a high-availability service which survives failures
Asymmetric clustering has one machine in hot-standby
mode
Symmetric clustering has multiple nodes running
applications, monitoring each other
Some clusters are for high-performance computing (HPC)
Applications must be written to use parallelization

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 25 CTU_LNK 26
GAGNE©2018 GAGNE©2018

Clustered Systems

Operating System structure


&
Operating system operations

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ,
CTU_LNK 27 CTU_LNK 28
GAGNE©2018 GALVIN, GAGNE©2018
Operating System Structure Operating System Structure
Multiprogramming needed for efficiency Timesharing (multitasking) is logical extension in which CPU
Single user cannot keep CPU and I/O devices busy at all times switches jobs so frequently that users can interact with each job
while it is running, creating interactive computing
Multiprogramming organizes jobs (code and data) so CPU
Response time should be < 1 second
always has one to execute
Each user has at least one program executing in memory
A subset of total jobs in system is kept in memory
process
One job selected and run via job scheduling
If several jobs ready to run at the same time CPU scheduling
When it has to wait (for I/O for example), OS switches to
swapping moves them in and
another job
out to run
Virtual memory allows execution of processes not
completely in memory
ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 29 CTU_LNK 30
GAGNE©2018 GAGNE©2018

Transition from User to


Operating System Operations Kernel Mode
Interrupt driven by hardware Timer to prevent infinite loop / process hogging resources
Software error or request creates exception or trap Set interrupt after specific period
Division by zero, request for operating system service Operating system decrements counter
When counter zero generate an interrupt
Other process problems include infinite loop, processes modifying
each other or the operating system Set up before scheduling process to regain control or terminate program that
exceeds allotted time
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
System call changes mode to kernel, return from call resets it to user

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 31 CTU_LNK 32
GAGNE©2018 GAGNE©2018
Operating System Components
Process management

Memory management Computing


File and storage
environment
Networking

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ,
CTU_LNK 33 CTU_LNK 34
GAGNE©2018 GALVIN, GAGNE©2018

Computing Environment Traditional computing


Traditional computing Blurring over time
Mobile computing Office environment
Distributed computing PCs connected to a network, terminals attached to mainframe
or minicomputers providing batch and timesharing
Client-Server computing
Now portals allowing networked and remote systems access to
Peer-to-Peer computing same resources
Web-based computing Home networks
Cloud computing Used to be single system, then modems
Now firewalled, networked

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 35 CTU_LNK 36
GAGNE©2018 GAGNE©2018
Mobile Computing Distributed Computing
Computing on handheld smart phones and tablet computers Collection of separate, possibly heterogeneous, systems networked
together
Devices share the distinguishing physical features of being
portable and lightweight Network is a communications path
Local Area Network (LAN)
Two OS currently dominate mobile computing:
Wide Area Network (WAN)
Apple iOS
Metropolitan Area Network (MAN)
Google Android
Network Operating System provides features between systems
across network
Communication scheme allows systems to exchange messages
Illusion of a single system

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 37 CTU_LNK 38
GAGNE©2018 GAGNE©2018

Client-Server Computing Peer-to-Peer Computing


Dumb terminals supplanted by smart PCs Another model of distributed system
Many systems now servers, responding to requests generated
by clients P2P does not distinguish clients and servers
Compute-server provides an interface to client to request services (i.e., Instead all nodes are considered peers
database)
May each act as client, server or both
File-server provides interface for clients to store and retrieve files Node must join P2P network
Registers its service with central lookup service on network, or
Broadcast request for service and respond to requests for service via discovery protocol
Examples include Napster and Gnutella
P2P system with no
centralized service

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 39 CTU_LNK 40
GAGNE©2018 GAGNE©2018
Web-Based Computing Cloud computing
Web has become ubiquitous A type of computing that delivers computing, storage and even
applications as a service across a network
PCs most prevalent devices
Many types of cloud computing:
Public cloud: a cloud available via the Internet to anyone willing to pay for the
More devices becoming networked to allow web access services

New category of devices to manage web traffic among similar Hybrid cloud: a cloud that includes both public and private cloud components
servers: load balancers
Software as a service (SaaS): one or more applications available via the Internet
Platform as a service (PaaS): a software stack ready for application use via the
Use of operating systems like Windows 95, client-side, have Internet (e.g., database server)
evolved into Linux and Windows XP, which can be clients and Infrastructure as service (IaaS): servers or storage available over the Internet
servers

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 41 CTU_LNK 42
GAGNE©2018 GAGNE©2018

History of Operating Systems


First generation 1945 - 1955
vacuum tubes, plug boards

History of Second generation 1955 - 1965


transistors, batch systems

operating systems Third generation 1965


ICs and multiprogramming
Fourth generation 1980 present
1980

personal computers
Present next 5-10 years
Mobile devices
Many-core computers

ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 43 CTU_LNK 44
GALVIN, GAGNE©2018 GAGNE©2018
Different Types of OS
Batch processing
Processes jobs one by one
Time sharing OS

Real-time OS
End of Chapter 1
Still time-sharing, but has deadlines for certain jobs
Distributed OS
Multiple computers run a single copy of OS
Embedded OS
Runs on cell phones, PDAs, tailored and is high efficient
ADAPTED FROM OPERATING SYSTEM CONCEPTS. SILBERSCHATZ, GALVIN,
CTU_LNK 45
GAGNE©2018

You might also like