Ch02-OS9e
Ch02-OS9e
Systems:
Internals Chapter 2
and Design
Principles Operating System
Overview
Ninth Edition, Global Edition
By William Stallings
• Convenience
• Efficiency
• Ability to evolve
Memory
System interconnect
translation Hardware
(bus)
I/O devices
Main
and
memory
networking
◼ Program development
◼ Program execution
◼ Access I/O devices
◼ Controlled access to files
◼ System access
◼ Error detection and response
◼ Accounting
Programs
and Data
I/O Controller
Processor Processor
Storage
OS
Programs
Data
Hardware upgrades
New services
Fixes
Time
Sharing
Multiprogrammed Systems
Batch Systems
Simple Batch
Systems
Serial
Processing
◼ Monitor
◼ User no longer has direct access to processor
◼ Job is submitted to computer operator who batches
them together and places them on an input device
◼ Program branches back to the monitor when finished
• While the user program is executing, it must not alter the memory area
containing the monitor
Timer
Privileged instructions
Interrupts
I/O devices
are slow
compared
to processor
Even with
automatic
job
sequencing
Processor is often
idle
1
Percent CPU Utilization = = 0.032 = 3.2%
31
Time
(a) Uniprogramming
Multiprogramming Time
(a) Uniprogramming
◼ There must be enough memory to hold the OS (resident monitor) and one user
Program A
program Run Wait Run Wait
◼ When one job needs to wait for I/O, the processor can switch to the other job, which is
likely not waiting
Program B for I/ORun
Wait Wait Run Wait
Copyright © 2018 Pearson Education, Ltd. All Rights Reserved.
Program B Wait Run Wait Run Wait
Multiprogramming
Combined Wait Wait
A B A B
Time
(b) Multiprogramming with two programs
CPU CPU
0% 0%
100% 100%
Memory Memory
0% 0%
100% 100%
Disk Disk
0% 0%
100% 100%
Terminal Terminal
0% 0%
100% 100%
Printer Printer
0% 0%
0 5 10 15
time
minutes
time
(a) Uniprogramming (b) Multiprogramming
◼ The system was first developed for the IBM 709 in 1961
◼ Ran on a computer with 32,000 36-bit words of main memory, with the resident
monitor consuming 5000 of that
0 0 0
Monitor Monitor Monitor
5000 5000 5000
JOB 4
JOB 1
15000 JOB 2
(JOB 1)
20000 20000
(JOB 2) (JOB 2)
25000 25000 25000
Free Free Free
32000 32000 32000
(d) (e) (f)
A program in execution
PC
Process
i
Process Base b
list Limit h
j
Management Other
registers
Context
Process
▪ The entire state of the A
Data
Program
process at any instant is (code)
contained in its context
b
▪ New features can be Process
Context
Data
designed and incorporated B h
Program
into the OS by expanding (code)
the context to include any
new information needed to
support the feature
Figure 2.8 Typical Process Implementation
Copyright © 2018 Pearson Education, Ltd. All Rights Reserved.
Causes of Errors
◼ Improper synchronization ◼ Nondeterminate program
◼ It is often the case that a operation
routine must be suspended ◼ When programs share memory,
awaiting an event elsewhere in and their execution is
the system interleaved by the processor,
they may interfere with each
◼ Improper design of the other by overwriting common
signaling mechanism can result memory areas in unpredictable
in loss or duplication ways
◼ The order in which programs
◼ Failed mutual exclusion are scheduled may affect the
◼ More than one user or program outcome of any particular
attempts to make use of a shared program
resource at the same time
◼ There must be some sort of ◼ Deadlocks
mutual exclusion mechanism that ◼ It is possible for two or more
permits only one routine at a time programs to be hung up
to perform an update against the waiting for each other
file
Copyright © 2018 Pearson Education, Ltd. All Rights Reserved.
Memory Management
◼ The OS has five principal storage
management responsibilities:
Automatic
Support of Protection
Process allocation Long-term
modular and access
isolation and storage
programming control
management
User
program
A
B.5 B.6
Disk
Address
Secondary
Memory
depending on the
circumstances
◼ Resource allocation
policies must Differential
consider: responsiveness
Pass Control
to Process
• Microkernel architecture
• Multithreading
• Symmetric multiprocessing
• Distributed operating systems
• Object-oriented design
◼ The approach:
Well suited to a
Simplifies Provides
distributed
implementation flexibility
environment
divided into
threads that can By breaking a single
run concurrently
application into multiple
Includes a processor context threads, a programmer has
and its own data area for a greater control over the
stack modularity of the
application and the timing
of application-related events
Process 1
Process 2
Process 3
Process 1
Process 2
Process 3
Blocked Running
2) The portion of the monitor that is always in main memory and available for execution
is referred to as the _________ .
3) __________ is a technique in which a process, executing an application, is divided into
threads that can run concurrently.
4) Two major problems with early serial processing systems were scheduling and __________ .
5) The central idea behind the simple batch-processing scheme is the use of a piece of software
known as the _________ .
6) Any resource allocation and scheduling policy must consider three factors: Fairness,
Differential responsiveness, and __________ .
7) A __________ is set at the beginning of each job to prevent any single job from
monopolizing the system.
8) The OS has five principal storage management responsibilities: process isolation, automatic
allocation and management, support of modular programming, protection and access control,
and __________ .
10) __________ was designed to keep the processor and I/O devices, including storage devices,
simultaneously busy to achieve maximum efficiency.
13) Three major lines of computer system development created problems in timing and
synchronization that contributed to the development of the concept of the process:
multiprogramming batch operation, time sharing, and __________ .
14) ___________ is a facility that allows programs to address memory from a logical point of
view, without regard to the amount of main memory physically available.
15) Security and protection as it relates to operating systems is grouped into four categories:
Availability, Data integrity, Authenticity, and __________ .
A) FPL B) JCL
C) DML D) SML