Professional Documents
Culture Documents
Structs
Structs
2. Computer-System Structures
(Ch. 2, S&G)
Objective
– to give a (selective) overview of
computer system architectures
OSes: 2. Structs 1
Contents
OSes: 2. Structs 2
1. A Modern Computer System
Fig 2.1, p.24
Line Printer
system bus
memory I/O controller
controller I/O controller
memory
OSes: 2. Structs continued 3
CPU and device controllers (drivers) can
execute concurrently.
OSes: 2. Structs 4
2. Interrupts
Types of events:
– completion of I/O, division by 0, system calls,
etc.
OSes: 2. Structs 8
System Calls Fig 2.9, p.44
trap to :
monitor :
system call n 3 return
:
user program
OSes: 2. Structs 9
3. I/O
Synchronous I/O
– the user process waits during I/O processing
Asynchronous I/O
– control returns to the user without waiting for
the I/O to complete
OSes: 2. Structs 10
I/O Forms Fig. 2.3, p.27
Synchronous Asynchronous
user requesting process user requesting process
OSes: 2. Structs 11
3.1. Synchronous I/O
OSes: 2. Structs 13
I/O Device Status Table Fig 2.4, p.28
OSes: 2. Structs 15
3.4. Memory Mapped I/O
OSes: 2. Structs 16
4. Caching
The cache is fast memory between the CPU
and main memory
– the CPU looks in the cache first for data
– new data taken from main memory is also
placed in the cache for quick access next time
Instruction caching
Cache management
– can affect performance drastically
OSes: 2. Structs 17
Cache Coherency
OSes: 2. Structs 18
5. Protection
OSes: 2. Structs 19
5.1. Dual-mode Operation
User mode
Monitor mode
– supervisor mode, root, superuser, system mode,
priveleged mode
Implemented in hardware
OS always runs in monitor mode
OSes: 2. Structs 20
5.2. Memory Protection
OSes: 2. Structs 21
Partitioning Memory Fig 2.7, p.40
0
monitor
256000
job 1
300040 300040
job 2 base register
420940
120900
job3
limit register
880000
job4
1024000
OSes: 2. Structs 22
Fig 2.8, p.41
OSes: 2. Structs 23
5.3. CPU Protection
OSes: 2. Structs 24