CH01 - Computer System Overview
CH01 - Computer System Overview
Systems:
Internals
and
Chapter 1
Design Computer
Principles
System Overview
Eighth Edition
Global Edition
By William Stallings
Operating System
Exploits
the hardware resources of one or
more processors
Provides a set of services to system users
Manages secondary memory and I/O
devices
Basic Elements
Process I/O
or Modules
Main System
Memory Bus
Processor
Performs the
Controls the
data
operation of
processing
the computer
functions
Referred to as
the Central
Processing
Unit (CPU)
Main Memory
Volatile
storage (e.g.
hard drive)
Moves data
between the
computer and communicatio
external ns equipment
environments
such as:
terminals
System Bus
Provides
for
communication among
processors, main
memory, and I/O
modules
Microprocessor
Invention
that brought about
desktop and handheld computing
Processor on a single chip
Fastest general purpose processor
Multiprocessors
processor reads
processor
(fetches)
executes each
instructions from
instruction
memory
Two steps
Instruction Fetch
and Execute
Theprocessor fetches the instruction
from memory
Program counter (PC) holds address of
the instruction to be fetched next
PC is incremented after each fetch
Instruction Register
(IR)
Processor interprets
Fetched instruction is
loaded into the instruction and
Instruction Register performs required
(IR) action:
Processor-
memory
Processor-I/O
Data processing
Control
Interrupts
Interrupt
the normal sequencing of the
processor
Provided to improve processor
utilization
most I/O devices are slower than the processor
processor must pause to wait for device
wasteful use of the processor
Table 1.1 Classes of Interrupts
Flow of Control
Without
Interrupts
Figure 1.5b
An interrupt occurs
while another
Two approaches:
interrupt is being
processed
• e.g. receiving data • disable interrupts
from a while an interrupt is
communications being processed
line and printing • use a priority
results at the same scheme
time
Memory Hierarchy
Major constraints in memory
amount
speed
expense (cost)
Memory must be able to keep up with the
processor
Cost of memory must be reasonable in
relationship to the other components
Memory Relationships
Faster Greater
access capacity =
time = smaller cost per
greater bit Greater
cost per capacity =
bit slower access
speed
The Memory Hierarchy
Going down the
hierarchy:
decreasing cost per
bit
increasing capacity
increasing access time
decreasing frequency
of access to the
memory by the
Cache Memory
Invisible to the OS
Interacts with other memory management hardware
Processor must access memory at least once per
instruction cycle (Processor is faster than memory)
Processor execution is limited by memory cycle time
Exploit the principle of locality with a small, fast
memory which contains a portion of main memory
C<<M
Cach
e cache
size
Desig number
block
of cache
n levels
size
Main
categori
es are:
write mapping
policy function
replacem
ent
algorithm
Cache and Block Size
Cache Block
Size Size
the unit of data
small caches
exchanged
have significant
between cache
impact on
and main
performance
memory
Mapping Function
∗ Determines which
cache location the block
will occupy when one block is
read in, another may
have to be replaced
Two constraints affect
design:
the more flexible the
mapping function, the
more complex is the
circuitry required to
search the cache
Replacement Algorithm
Least Recently Used (LRU)
Algorithm
effective strategy is to replace a block that
has been in the cache the longest with no
references to it
hardware mechanisms are needed to
chooses
identify thewhich
leastblock to replace
recently usedwhen a new
block
block is to be loaded into the cache
Write Policy
Direct
Programme Interrupt-
Memory
d I/O Driven I/O
Access (DMA)
Programmed I/O
The I/O module performs the requested
action then sets the appropriate bits in the
I/O status register
The processor periodically checks the
status of the I/O module until it determines
the instruction is complete
With programmed I/O the performance
level of the entire system is severely
degraded
Interrupt-Driven I/O
Processor
issues an
I/O The
command processor
to a module executes the
and then data transfer
goes on to and then
do some resumes its
other useful former
work processing