CH01-Computer System Overview
CH01-Computer System Overview
Computer System
Overview
BIT1213 OPERATING SYSTEMS
Objectives
Instruction Execution
Interrupts
Cache Memory
Operating System
Operating System is a program or software that help to :-
Operating System
Application
Processor
Main
Memory
I/O
Modules
System
Bus
Data Bus
COntroller Bus
Address Bus
Processor
Controls the
operation of the
computer
What are the main part of processor :- ALU ( arithmetic logic unit), Control unit, Register
Referred to as the
Central Processing
Unit (CPU)
AMD
Intel
=Pins cant be touched with hand
Main Memory
Main Memory = RAM (random access memory)
Volatile
I/O Modules
modules are attached to motherboard
storage (e.g.
hard drive)
Moves data between
the computer and
external environments
such as:
communication
s equipment
terminals
System Bus
Provides for
communication
among
processors,
main memory,
and I/O
modules
Instruction Execution
START
Fetch Stage
Execute Stage
Fetch Next
Instruction
Execute
Instruction
HALT
Fetch Stage
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
Execute Stage
CPU Registers
Memory
300 1 9 4 0
3 0 0 PC
AC 301 5 9 4 1
1 9 4 0 IR 302 2 9 4 1
940 0 0 0 3
941 0 0 0 2
940 0 0 0 3
941 0 0 0 2
Step 1
Step 2
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
CPU Registers
Memory
300 1 9 4 0
3 0 1 PC
0 0 0 3 AC 301 5 9 4 1
5 9 4 1 IR 302 2 9 4 1
CPU Registers
3 0 2 PC
0 0 0 5 AC
5 9 4 1 IR
940 0 0 0 3
941 0 0 0 2
940 0 0 0 3
941 0 0 0 2
Step 3
Step 4
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
CPU Registers
3 0 1 PC
0 0 0 3 AC
1 9 4 0 IR
CPU Registers
Memory
300 1 9 4 0
3 0 2 PC
0 0 0 5 AC 301 5 9 4 1
2 9 4 1 IR 302 2 9 4 1
3+2=5
CPU Registers
3 0 3 PC
0 0 0 5 AC
2 9 4 1 IR
940 0 0 0 3
941 0 0 0 2
940 0 0 0 3
941 0 0 0 5
Step 5
Step 6
Interrupts
Table 1.1
Classes of Interrupts
Program
Timer
I/O
Hardware
failure
User
Program
I/O
Program
4
Figure 1.5a
I/O
Command
WRITE
User
Program
1
WRITE
5
2a
END
2
Flow of Control
Without
Interrupts
2b
WRITE
WRITE
3a
3
3b
WRITE
WRITE
(a) No interrupts
(b) Inter
User
Program
I/O
Program
4
I/O
Command
WRITE
User
Program
I/O
Program
4
WRITE
I/O
Command
User
Program
1
WRITE
5
2a
Figure 1.5b
END
2
Interrupt
Handler
2b
WRITE
WRITE
WRITE
END
3a
3
3b
WRITE
WRITE
(a) No interrupts
WRITE
(c) In
No interrupts
I/O
Program
4
I/O
Command
User
Program
I/O
Program
4
WRITE
I/O
Command
User
Program
I/O
Program
4
WRITE
I/O
Command
Figure 1.5c
2a
END
2
Interrupt
Handler
2b
WRITE
Interrupt
Handler
5
WRITE
END
END
3a
3
3b
WRITE
(b) Interrupts; short I/O wait
WRITE
(c) Interrupts; long I/O wait
User Program
Interrupt Handler
1
2
Interrupt
occurs here
i
i+1
Fetch Stage
Execute Stage
Interrupt Stage
Interrupts
Disabled
START
Fetch next
instruction
Execute
instruction
Interrupts
Enabled
Check for
interrupt;
initiate interrupt
handler
HALT
Hardware
Device controller or
other system hardware
issues an interrupt
Processor finishes
execution of current
instruction
Software
Save remainder of
process state
information
Process interrupt
Processor signals
acknowledgment
of interrupt
Restore process state
information
Processor pushes PSW
and PC onto control
stack
Restore old PSW
and PC
Processor loads new
PC value based on
interrupt
Multiple Interrupts
An interrupt occurs while
another interrupt is being
processed
Two approaches:
Memory Hierarchy
amount
speed
expense
Memory Relationships
Faster access
time =
greater cost
per bit
Greater capacity =
smaller cost per bit
Greater capacity
= slower access
speed
go through many slot
Inb
Me oard
mo
ry
Ou
t
Sto boar
rag d
e
Of
S t o f - li n e
rag
e
gRe r s
e
i st
Ca
e
ch
in
M a or y
m
Me
sk
Di
tic
ne OM
g
M a D- R W
C D -R W
R M
C
DD V D- R A y
a
DV lu-R
B
ne
ag
tic
p
Ta
higher level
Figure 1.14
Principle of Locality
stored in low level - easier to access
Secondary
Memory
hard disc - permanent memory
Also referred to
as auxiliary
memory
external
nonvolatile
used to store
program and data
files
Cache Memory
Invisible to the OS
Block Transfer
Word Transfer
Main Memory
Cache
CPU
Fast
Slow
Level 2
(L2) cache
Level 1
(L1) cache
CPU
Fastest
Fast
Level 3
(L3) cache
Less
fast
Main
Memory
Slow
Line
Number Tag
0
1
2
Block
Memory
address
0
1
2
3
Block 0
(K words)
C-1
Block Length
(K Words)
(a) Cache
Block M 1
2n - 1
Word
Length
START
RA - read address
Receive address
RA from CPU
Is block
containing RA
in cache?
Access main
memory for block
containing RA
No
Yes
Allocate cache
slot for main
memory block
Fetch RA word
and deliver
to CPU
Load main
memory block
into cache slot
Deliver RA word
to CPU
DONE
following characteristics:
SMP Advantages
Performance
Scaling
Availability
Incremental Growth
Processor
Processor
L1 Cache
Processor
L1 Cache
L2 Cache
L1 Cache
L2 Cache
L2 Cache
System Bus
Main
Memory
I/O
Subsystem
I/O
Adapter
I/O
Adapter
I/O
Adapter
Multicore Computer
Core 0
Core 1
Core 2
Core 3
Core 4
Core 5
32 kB 32 kB
L1-I L1-D
32 kB 32 kB
L1-I L1-D
32 kB 32 kB
L1-I L1-D
32 kB 32 kB
L1-I L1-D
32 kB 32 kB
L1-I L1-D
32 kB 32 kB
L1-I L1-D
256 kB
L2 Cache
256 kB
L2 Cache
256 kB
L2 Cache
256 kB
L2 Cache
256 kB
L2 Cache
256 kB
L2 Cache
12 MB
L3 Cache
DDR3 Memory
Controllers
3 8B @ 1.33 GT/s
QuickPath
Interconnect
Review Questions
1.
2.
3.
Review Questions
4. Suppose the hypothetical processor of Figure 1.3 also has two I/O
instructions:
0011 Load AC from I/O
0111 Store AC to I/O
In these cases, the 12-bit address identifies a particular external device.
Show the program execution (using format of Figure 1.4) for the
following program:
1.
Load AC from device 5.
2.
Add contents of memory location 940.
3.
Store AC to device 6.
Assume that the next value retrieved from device 5 is 3 and that location
940 contains a value of 2.