System Organization Architecture

105 views 11:10 am 0 Comments June 27, 2023

Operating System Concepts
Chapter 1 { Introduction
Based on the 9th Edition of:
Abraham Silberschatz, Peter B. Galvin and Jreg Gagne:.
Operating System
Concepts
Department of Information Technology, College of Business, Law & Governance
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Learning 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 several open-source operating systems
Chapter 1 { Introduction Operating System Concepts 2
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Outline
1 Introduction
2 Computer-System Organization
3 Computer-System Architecture
4 Operating-System Structure
5 Process/Memory/Storage Management
6 Protection and Security
7 Computing Environments
Chapter 1 { Introduction Operating System Concepts 3
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Introduction
What is an Operating System?
A program that 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
Chapter 1 { Introduction Operating System Concepts 4
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
What Operating Systems Do?
Computer system can be divided into four components:
1 Hardware { provides basic computing resources (e.g. 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 (e.g., Word processors, compilers, web browsers,
database systems, video games)
4 Users { (e.g., People, machines, other computers)
Chapter 1 { Introduction Operating System Concepts 5
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
What Operating Systems Do?
Abstract view of the components of a computer system
user
1
user
2
user
3
computer hardware
operating system
system and application programs
compiler assembler text editor database
system
user
n
… …
Chapter 1 { Introduction Operating System Concepts 6
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
What Operating Systems Do?
User View
Users want convenience, ease of use and good performance {
Dont care about
resource utilization
But shared computer such as mainframe or minicomputer
must keep all users happy
Users of dedicate systems such as
workstations have dedicated
resources but frequently use shared resources from
servers
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
Chapter 1 { Introduction Operating System Concepts 7
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
What Operating Systems Do?
System View
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
Chapter 1 { Introduction Operating System Concepts 8
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
What Operating Systems Do?
Defining Operating Systems
No universally accepted definition
Everything a vendor ships when you order an operating system
is a good approximation { but varies widely
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.
Chapter 1 { Introduction Operating System Concepts 9
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 In what way is an operating system like a government?
A. It seldom functions correctly.
B. It creates an environment within which other programs can do
useful work.
C. It performs most useful functions by itself.
D. It is always concerned primarily with the individual’s needs.
Answer:
Chapter 1 { Introduction Operating System Concepts 10
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 In what way is an operating system like a government?
A. It seldom functions correctly.
B. It creates an environment within which other programs can do
useful work.
C. It performs most useful functions by itself.
D. It is always concerned primarily with the individual’s needs.
Answer: B
Chapter 1 { Introduction Operating System Concepts 10
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 In what way is an operating system like a government?
A. It seldom functions correctly.
B. It creates an environment within which other programs can do
useful work.
C. It performs most useful functions by itself.
D. It is always concerned primarily with the individual’s needs.
Answer: B
2 operating systems are designed primarily to maximize
resource utilization.
A. PC
B. Handheld computer
C. Mainframe
D. Network
Answer:
Chapter 1 { Introduction Operating System Concepts 10
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 In what way is an operating system like a government?
A. It seldom functions correctly.
B. It creates an environment within which other programs can do
useful work.
C. It performs most useful functions by itself.
D. It is always concerned primarily with the individual’s needs.
Answer: B
2 operating systems are designed primarily to maximize
resource utilization.
A. PC
B. Handheld computer
C. Mainframe
D. Network
Answer: C
Chapter 1 { Introduction Operating System Concepts 10
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Computer-System Operation
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
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
Chapter 1 { Introduction Operating System Concepts 11
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
USB controller
mouse keyboard printer monitor
disks
graphics
adapter
disk
controller
memory
CPU
on-line
Chapter 1 { Introduction Operating System Concepts 12
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Computer-System Operation (cont.)
I/O devices and the CPU can execute concurrently
Each device controller is in charge of a particular device type
Loads operating system kernel and starts execution
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
Chapter 1 { Introduction Operating System Concepts 13
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Computer-System Operation (cont.)
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
Chapter 1 { Introduction Operating System Concepts 14
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Interrupt time line for a single process doing output
user
process
executing
CPU
I/O interrupt
processing
I/O
request
transfer
done
I/O
request
transfer
done
I/O
device
idle
transferring
Chapter 1 { Introduction Operating System Concepts 15
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
I/O Structure
After I/O starts, control returns to user program only upon
I/O completion
Wait instruction idles the CPU until the next interrupt
Wait loop (contention for memory access)
At most one I/O request is outstanding at a time, no
simultaneous I/O processing
Chapter 1 { Introduction Operating System Concepts 16
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
I/O Structure (Cont.)
After I/O starts, control returns to user program without
waiting for I/O completion
System call { request to the OS to allow user to wait for I/O
completion
Device-status table contains entry for each I/O device
indicating its type, address, and state
OS indexes into I/O device table to determine device status
and to modify table entry to include interrupt
Chapter 1 { Introduction Operating System Concepts 17
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Storage Definitions and Notation Review
A basic unit of computer storage is the bit that can contain
one of two values
0 and 1.
The smallest convenient chunk of storage is a
byte (usually a
collection of 8 bits) that can contain one symbol/character.
A
kilobyte, or KB, is made up of 210 = 1024 bytes
A
megabyte, or MB, is made up of 220 = 10242 bytes
A
gigabyte, or GB, is made up of 230 = 10243 bytes
A
terabyte, or TB, is made up of 240 = 10244 bytes
A
petabyte, or PB, is made up of 250 = 10245 bytes
Chapter 1 { Introduction Operating System Concepts 18
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Storage Structure
Main memory { only large storage media that the CPU can
access directly (
Random access, Typically volatile)
Secondary storage { extension of main memory that provides
large
nonvolatile storage capacity
Hard disks { rigid metal or glass platters covered with
magnetic recording material
Disk surface is logically divided into tracks, which are
subdivided into
sectors
The disk controller determines the logical interaction between
the device and the computer
Solid-state disks { faster than hard disks, nonvolatile
(becoming more popular)
Chapter 1 { Introduction Operating System Concepts 19
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Storage Structure (cont.)
Storage systems organized in hierarchy
Speed
Cost
Volatility
Caching { copying information into faster storage system;
main memory can be viewed as a cache for secondary storage
Device Driver { (for each device controller to manage I/O)
Provides uniform interface between controller and kernel
Chapter 1 { Introduction Operating System Concepts 20
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Storage-device hierarchy
registers
cache
main memory
solid-state disk
magnetic disk
optical disk
magnetic tapes
Chapter 1 { Introduction Operating System Concepts 21
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Caching
Important principle, performed at many levels in a computer
(in hardware, operating system, software)
Information in use copied from slower to faster storage
temporarily
Faster storage (cache) checked first to determine if
information is there
If it is, information used directly from the cache (fast)
If not, data copied to cache and used there
Chapter 1 { Introduction Operating System Concepts 22
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
Direct Memory Access (DMA) 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
Chapter 1 { Introduction Operating System Concepts 23
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Organization
How a Modern Computer Works
thread of execution
instructions
and
data
instruction execution
cycle
data movement
DMA
memory
interrupt
cache
data
I/O request
CPU (*N)
device
(*M)
Chapter 1 { Introduction Operating System Concepts 24
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 The most common secondary storage device is .
A. random access memory
B. solid state disks
C. tape drives
D. magnetic disk
Answer:
Chapter 1 { Introduction Operating System Concepts 25
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 The most common secondary storage device is .
A. random access memory
B. solid state disks
C. tape drives
D. magnetic disk
Answer: D
Chapter 1 { Introduction Operating System Concepts 25
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 The most common secondary storage device is .
A. random access memory
B. solid state disks
C. tape drives
D. magnetic disk
Answer: D
2 True or False { The operating system kernel consists of all
system and application programs in a computer.
Answer:
Chapter 1 { Introduction Operating System Concepts 25
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 The most common secondary storage device is .
A. random access memory
B. solid state disks
C. tape drives
D. magnetic disk
Answer: D
2 True or False { The operating system kernel consists of all
system and application programs in a computer.
Answer: False
Chapter 1 { Introduction Operating System Concepts 25
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 The most common secondary storage device is .
A. random access memory
B. solid state disks
C. tape drives
D. magnetic disk
Answer: D
2 True or False { The operating system kernel consists of all
system and application programs in a computer.
Answer: False
3 True or False { Flash memory is slower than DRAM but
needs no power to retain its contents.
Answer:
Chapter 1 { Introduction Operating System Concepts 25
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 The most common secondary storage device is .
A. random access memory
B. solid state disks
C. tape drives
D. magnetic disk
Answer: D
2 True or False { The operating system kernel consists of all
system and application programs in a computer.
Answer: False
3 True or False { Flash memory is slower than DRAM but
needs no power to retain its contents.
Answer: True
Chapter 1 { Introduction Operating System Concepts 25
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Architecture
Most systems use a single general-purpose processor
Most systems have special-purpose processors as well
Multiprocessors systems growing in use and importance
Also known as parallel systems, tightly-coupled systems
Advantages include:
Increased throughput
Economy of scale
Increased reliability
{ graceful degradation or fault tolerance
Two types:
1 Asymmetric Multiprocessing { each processor is assigned a
specie task.
2 Symmetric Multiprocessing { each processor performs all tasks
Chapter 1 { Introduction Operating System Concepts 26
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Architecture
Symmetric multiprocessing architecture
CPU0
registers
cache
CPU
1
registers
cache
CPU
2
registers
cache
memory
Chapter 1 { Introduction Operating System Concepts 27
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Architecture
A dual-core design with two cores placed on the same chip
CPU core0
registers
cache
CPU core
1
registers
cache
memory
Chapter 1 { Introduction Operating System Concepts 28
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Architecture
Clustered Systems
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
Some have distributed lock manager (DLM) to avoid
conflicting operations
Chapter 1 { Introduction Operating System Concepts 29
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computer-System Architecture
General structure of a clustered system
computer
interconnect
computer
interconnect
computer
storage area
network
Chapter 1 { Introduction Operating System Concepts 30
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer:
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer: True
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer: True
2 True or False { A dual-core system requires each core has
its own cache memory.
Answer:
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer: True
2 True or False { A dual-core system requires each core has
its own cache memory.
Answer: False
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer: True
2 True or False { A dual-core system requires each core has
its own cache memory.
Answer: False
3 True or False { There is no universally accepted definition
of an operating system.
Answer:
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer: True
2 True or False { A dual-core system requires each core has
its own cache memory.
Answer: False
3 True or False { There is no universally accepted definition
of an operating system.
Answer: True
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer: True
2 True or False { A dual-core system requires each core has
its own cache memory.
Answer: False
3 True or False { There is no universally accepted definition
of an operating system.
Answer: True
4 True of False { Solid state disks are considered volatile
storage.
Answer:
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 True or False { Interrupts may be triggered by either
hardware of software
Answer: True
2 True or False { A dual-core system requires each core has
its own cache memory.
Answer: False
3 True or False { There is no universally accepted definition
of an operating system.
Answer: True
4 True of False { Solid state disks are considered volatile
storage.
Answer: False
Chapter 1 { Introduction Operating System Concepts 31
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Operating-System Structure
Multiprogramming (Batch system) needed for efficiency
Single user cannot keep CPU and I/O devices busy at all
times
Multiprogramming organizes jobs, 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
Chapter 1 { Introduction Operating System Concepts 32
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Operating-System Structure
Memory layout for a multiprogramming system
job 1
0
Max
operating system
job 2
job 3
job 4
Chapter 1 { Introduction Operating System Concepts 33
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
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
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 dont fit in memory, swapping moves them in and
out to run
Virtual memory allows execution of processes not completely
in memory
Chapter 1 { Introduction Operating System Concepts 34
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Operating-System Operations
Interrupt driven (hardware and software)
Hardware interrupt by one of the devices
Software interrupt (
exception or trap):
Software error (e.g., division by zero)
Request for operating system service
Other process problems include infinite loop, processes
modifying each other or the operating system
Chapter 1 { Introduction Operating System Concepts 35
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Operating-System Operations
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
Chapter 1 { Introduction Operating System Concepts 36
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Operating-System Operations
Transition from user to kernel mode
user process executing
user process
kernel
calls system call return from system call
user mode
(mode bit = 1)
trap
mode bit = 0
return
mode bit = 1
kernel mode
(mode bit = 0)
execute system call
Chapter 1 { Introduction Operating System Concepts 37
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Operating-System Operations
Timer
Timer to prevent infinite loop / process hogging resources
Timer is set to interrupt the computer after some time period
Keep a counter that is decremented by the physical clock.
Operating system set the counter (privileged instruction)
When counter zero generate an interrupt
Set up before scheduling process to regain control or terminate
program that exceeds allotted time
Chapter 1 { Introduction Operating System Concepts 38
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following would lead you to believe that a given
system is an SMP-type (Symmetric Multiprocessing) system?
A. Each processor is assigned a specific task.
B. There is a bossworker relationship between the processors.
C. Each processor performs all tasks within the operating system.
D. None of the above
Answer:
Chapter 1 { Introduction Operating System Concepts 39
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following would lead you to believe that a given
system is an SMP-type (Symmetric Multiprocessing) system?
A. Each processor is assigned a specific task.
B. There is a bossworker relationship between the processors.
C. Each processor performs all tasks within the operating system.
D. None of the above
Answer: C
Chapter 1 { Introduction Operating System Concepts 39
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following would lead you to believe that a given
system is an SMP-type (Symmetric Multiprocessing) system?
A. Each processor is assigned a specific task.
B. There is a bossworker relationship between the processors.
C. Each processor performs all tasks within the operating system.
D. None of the above
Answer: C
2 A can be used to prevent a user program from never
returning control to the operating system.
A. portal
B. program counter
C. firewall
D. timer
Answer:
Chapter 1 { Introduction Operating System Concepts 39
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following would lead you to believe that a given
system is an SMP-type (Symmetric Multiprocessing) system?
A. Each processor is assigned a specific task.
B. There is a bossworker relationship between the processors.
C. Each processor performs all tasks within the operating system.
D. None of the above
Answer: C
2 A can be used to prevent a user program from never
returning control to the operating system.
A. portal
B. program counter
C. firewall
D. timer
Answer: D
Chapter 1 { Introduction Operating System Concepts 39
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Process Management
A process is a program in execution. It is a unit of work
within the system. Program is a
passive entity, process is an
active entity.
Process needs resources (e.g., CPU, memory, I/O, files, and
Initialization data) to accomplish its task
Process termination requires reclaim of any reusable resources
Single-threaded process has one
program counter specifying
location of next instruction to execute
Multi-threaded process has one program counter per thread
Typically system has many processes, some user, some
operating system running concurrently on one or more CPUs
Chapter 1 { Introduction Operating System Concepts 40
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Process Management
The operating system is responsible for the following activities in
connection with process management:
Creating and deleting both user and system processes
Suspending and resuming processes
Providing mechanisms for process synchronization
Providing mechanisms for process communication
Providing mechanisms for deadlock handling
Chapter 1 { Introduction Operating System Concepts 41
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Memory Management
To execute a program all (or part) of the instructions must be
in memory
All (or part) of the data that is needed by the program must
be in memory.
Memory management determines what is in memory and
when
Optimizing CPU utilization and computer response to users
Memory management activities
Keeping track of which parts of memory are currently being
used and by whom
Deciding which processes (or parts thereof) and data to move
into and out of memory
Allocating and deallocating memory space as needed
Chapter 1 { Introduction Operating System Concepts 42
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Storage Management
OS provides uniform, logical view of information storage { the file
File-System management
Files usually organized into directories
Access control on most systems to determine who can access
what
OS activities include
Creating and deleting files and directories
Primitives to manipulate files and directories
Mapping files onto secondary storage
Backup files onto stable (non-volatile) storage media
Chapter 1 { Introduction Operating System Concepts 43
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Mass-Storage Management
Usually disks used to store data that does not fit in main
memory or data that must be kept for a “long” period of time
Proper management is of central importance
Entire speed of computer operation hinges on disk subsystem
and its algorithms
OS activities
Free-space management
Storage allocation
Disk scheduling
Chapter 1 { Introduction Operating System Concepts 44
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Mass-Storage Management
Performance of various levels of storage
Level
Name
Typical size
Implementation
technology
Access time (ns)
Bandwidth (MB/sec)
Managed by
Backed by
1
registers
< 1 KB
custom memory
with multiple
ports CMOS
0.25 – 0.5
20,000 – 100,000
compiler
cache
2
cache
< 16MB
on-chip or
o-chip
CMOS SRAM
0.5 – 25
5,000 – 10,000
hardware
main memory
3
main memory
< 64GB
CMOS SRAM
80 – 250
1,000 – 5,000
operating system
disk
4
solid state disk
< 1 TB
ash memory
25,000 – 50,000
500
operating system
disk
5
magnetic disk
< 10 TB
magnetic disk
5,000,000
20 – 150
operating system
disk or tape
Chapter 1 { Introduction Operating System Concepts 45
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Mass-Storage Management
Multitasking environments must be careful to use most recent
value, no matter where it is stored in the storage hierarchy
Migration of data “A” from disk to register
magnetic A A A
disk
main
memory
hardware
cache register
Multiprocessor environment must provide cache coherency in
hardware such that all CPUs have the most recent value in
their cache
Distributed environment situation even more complex {several
copies of a datum can exist
Chapter 1 { Introduction Operating System Concepts 46
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
I/O Subsystem
One purpose of OS is to hide peculiarities of hardware devices
from the user
I/O subsystem responsible for
Memory management of I/O including buffering (storing data
temporarily while it is being transferred), caching (storing parts
of data in faster storage for performance), spooling (the
overlapping of output of one job with input of other jobs)
General device-driver interface
Drivers for specific hardware devices
Chapter 1 { Introduction Operating System Concepts 47
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Protection and Security
Protection { any mechanism for controlling access of
processes or users to resources defined by the OS
Security { defense of the system against internal and external
attacks (e.g., denial-of-service, worms, viruses, identity theft)
Systems generally first distinguish among users, to determine
who can do what
User identities (user IDs, security IDs) include name and
associated number, one per user
Group identifier (
group ID) allows set of users to be defined
and controls managed
Privilege escalation allows user to change to effective ID with
more rights
Chapter 1 { Introduction Operating System Concepts 48
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 A clustered system .
A. gathers together multiple CPUs to accomplish computational
work
B. is an operating system that provides file sharing across a
network
C. is used when rigid time requirements are present
D. can only operate one application at a time
Answer:
Chapter 1 { Introduction Operating System Concepts 49
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 A clustered system .
A. gathers together multiple CPUs to accomplish computational
work
B. is an operating system that provides file sharing across a
network
C. is used when rigid time requirements are present
D. can only operate one application at a time
Answer: A
Chapter 1 { Introduction Operating System Concepts 49
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 A clustered system .
A. gathers together multiple CPUs to accomplish computational
work
B. is an operating system that provides file sharing across a
network
C. is used when rigid time requirements are present
D. can only operate one application at a time
Answer: A
2 True or False { All computer systems have some sort of
user interaction.
Answer:
Chapter 1 { Introduction Operating System Concepts 49
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 A clustered system .
A. gathers together multiple CPUs to accomplish computational
work
B. is an operating system that provides file sharing across a
network
C. is used when rigid time requirements are present
D. can only operate one application at a time
Answer: A
2 True or False { All computer systems have some sort of
user interaction.
Answer: False
Chapter 1 { Introduction Operating System Concepts 49
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 A clustered system .
A. gathers together multiple CPUs to accomplish computational
work
B. is an operating system that provides file sharing across a
network
C. is used when rigid time requirements are present
D. can only operate one application at a time
Answer: A
2 True or False { All computer systems have some sort of
user interaction.
Answer: False
3 True or False { Solid state disks are generally faster than
magnetic disks.
Answer:
Chapter 1 { Introduction Operating System Concepts 49
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 A clustered system .
A. gathers together multiple CPUs to accomplish computational
work
B. is an operating system that provides file sharing across a
network
C. is used when rigid time requirements are present
D. can only operate one application at a time
Answer: A
2 True or False { All computer systems have some sort of
user interaction.
Answer: False
3 True or False { Solid state disks are generally faster than
magnetic disks.
Answer: True
Chapter 1 { Introduction Operating System Concepts 49
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Kernel Data Structure
Many similar to standard programing dat structure
Singly linked list
data data data null
• • •
Doubly linked list
data null data data data null
• • •
Circular linked list
data data data data
• • •
Chapter 1 { Introduction Operating System Concepts 50
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Kernel Data Structure
Binary search tree left right
17
35
40
42
12
6 14
Search performance is O(n)
Balanced binary search tree is O(lg n)
Chapter 1 { Introduction Operating System Concepts 51
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Kernel Data Structure
Hash function can create a hash map
0 1 . . n
value
hash map
hash_function(key)
Bitmap { string of n binary digits representing the status of n
items
Chapter 1 { Introduction Operating System Concepts 52
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Traditional
Stand-alone general purpose machines
But blurred as most systems interconnect with others (i.e.,
the Internet)
Portals provide web access to internal systems
Network computers (thin clients) are like Web terminals
Mobile computers interconnect via
wireless networks
Networking becoming ubiquitous { even home systems use
firewalls to protect home computers from Internet attacks
Chapter 1 { Introduction Operating System Concepts 53
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Mobile
Handheld smartphones, tablets, etc.
Extra feature more OS features (e.g., GPS)
Allows new types of apps like
augmented reality
Use IEEE 802.11 wireless, or cellular data networks for
connectivity
Leaders are
Apple iOS and Google Android
Chapter 1 { Introduction Operating System Concepts 54
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Distributed
Collection of separate, possibly heterogeneous, systems
networked together
Network is a communications path, TCP/IP most common
Local Area Network (LAN)
Wide Area Network (WAN)
Metropolitan Area Network (MAN)
Personal Area Network (PAN)
Network Operating System provides features between systems
across network (such as communication)
Chapter 1 { Introduction Operating System Concepts 55
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Client-Server
Dumb terminals supplanted by smart PCs
Many systems now
servers, responding to requests generated
by
clients
Compute-server system provides an interface to client to
request services (i.e., database)
File-server system provides interface for clients to store and
retrieve files
Chapter 1 { Introduction Operating System Concepts 56
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Client-Server (Cont.)
Server Network
client
desktop
client
laptop
client
smartphone
Chapter 1 { Introduction Operating System Concepts 57
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Peer-to-Peer (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, or
Broadcast request for service and respond to requests for
service via
discovery protocol
Examples include Napster and Gnutella, Voice over IP (VoIP)
such as Skype
Chapter 1 { Introduction Operating System Concepts 58
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Pee-to-Peer (Cont.)
client
client client
client client
Chapter 1 { Introduction Operating System Concepts 59
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Virtualization
Allows operating systems to run applications within other OSs
{vast and growing industry
Emulation used when source CPU type different from target
type (i.e. PowerPC to Intel x86)
Virtualization { OS natively compiled for CPU, running guest
OSs also natively compiled
Consider VMware running WinXP guests, each running
applications, all on native WinXP
host OS
VMM (virtual machine Manager) provides virtualization
services
Chapter 1 { Introduction Operating System Concepts 60
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Virtualization (cont.)
(a)
processes
hardware
kernel
(b)
programming
interface
processes
processes
processes
kernel kernel kernel
VM1 VM3 VM2
manager
hardware
virtual machine
Chapter 1 { Introduction Operating System Concepts 61
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Cloud
Delivers computing, storage, even apps as a service across a
network, and has the following 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
Software as a Service (SaaS) { one or more applications
available via the Internet (i.e., word processor)
Platform as a Service (PaaS) { software stack ready for
application use via the Internet (i.e., a database server)
Infrastructure as a Service (IaaS) { servers or storage available
over Internet (i.e., storage available for backup use)
Chapter 1 { Introduction Operating System Concepts 62
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Computing Environments
Cloud (Cont.)
firewall
cloud
customer
interface
load balancer
virtual
machines
virtual
machines
servers servers
storage
Internet
customer
requests
cloud
management
commands
cloud
managment
services
Chapter 1 { Introduction Operating System Concepts 63
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
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 OSs, 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
Chapter 1 { Introduction Operating System Concepts 64
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
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)
Chapter 1 { Introduction Operating System Concepts 65
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Embedded computers typically run on a operating
system.
A. real-time
B. Windows XP
C. network
D. clustered
Answer:
Chapter 1 { Introduction Operating System Concepts 66
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Embedded computers typically run on a operating
system.
A. real-time
B. Windows XP
C. network
D. clustered
Answer: A
Chapter 1 { Introduction Operating System Concepts 66
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Embedded computers typically run on a operating
system.
A. real-time
B. Windows XP
C. network
D. clustered
Answer: A
2 Which of the following is a property of peer-to-peer systems?
A. Clients and servers are not distinguished from one another.
B. Separate machines act as either the client of the server but not
both.
C. They do not offer any advantages over traditional client-server
systems.
D. They suffer from the server acting as the bottleneck in
performance.
Answer:
Chapter 1 { Introduction Operating System Concepts 66
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Embedded computers typically run on a operating
system.
A. real-time
B. Windows XP
C. network
D. clustered
Answer: A
2 Which of the following is a property of peer-to-peer systems?
A. Clients and servers are not distinguished from one another.
B. Separate machines act as either the client of the server but not
both.
C. They do not offer any advantages over traditional client-server
systems.
D. They suffer from the server acting as the bottleneck in
performance.
Answer: A
Chapter 1 { Introduction Operating System Concepts 66
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following operating systems is not open source?
A. Windows
B. BSD UNIX
C. Linux
D. PCLinuxOS
Answer:
Chapter 1 { Introduction Operating System Concepts 67
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following operating systems is not open source?
A. Windows
B. BSD UNIX
C. Linux
D. PCLinuxOS
Answer: A
Chapter 1 { Introduction Operating System Concepts 67
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following operating systems is not open source?
A. Windows
B. BSD UNIX
C. Linux
D. PCLinuxOS
Answer: A
2 True or False { UNIX does not allow users to escalate
privileges to gain extra permissions for a restricted activity.
Answer:
Chapter 1 { Introduction Operating System Concepts 67
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following operating systems is not open source?
A. Windows
B. BSD UNIX
C. Linux
D. PCLinuxOS
Answer: A
2 True or False { UNIX does not allow users to escalate
privileges to gain extra permissions for a restricted activity.
Answer: False
Chapter 1 { Introduction Operating System Concepts 67
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following operating systems is not open source?
A. Windows
B. BSD UNIX
C. Linux
D. PCLinuxOS
Answer: A
2 True or False { UNIX does not allow users to escalate
privileges to gain extra permissions for a restricted activity.
Answer: False
3 True or False { Processors for most mobile devices run at a
slower speed than a processor in a desktop PC.
Answer:
Chapter 1 { Introduction Operating System Concepts 67
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
Quick Quiz
1 Which of the following operating systems is not open source?
A. Windows
B. BSD UNIX
C. Linux
D. PCLinuxOS
Answer: A
2 True or False { UNIX does not allow users to escalate
privileges to gain extra permissions for a restricted activity.
Answer: False
3 True or False { Processors for most mobile devices run at a
slower speed than a processor in a desktop PC.
Answer: True
Chapter 1 { Introduction Operating System Concepts 67
Introduction Computer-System Organization Architecture Structure Management Security Computing Environment
End of Chapter 1
Chapter 1 { Introduction Operating System Concepts 68

Tags: , , , , , , , , , ,