Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Applied Operating System Concepts 2.1 Silberschatz, Galvin, and Gagne 1999
Computer-System Architecture
system bus
memory controller
memory
Applied Operating System Concepts 2.2 Silberschatz, Galvin, and Gagne 1999
Computer-System Operation
Applied Operating System Concepts 2.3 Silberschatz, Galvin, and Gagne 1999
!"#$%&'()*(+,-./,&."-
#&'()"*+,''(-&+.*/"0
10$/2+"/$%34&5$%,6(7'$/
-&'/0&6(7'$/
81479
!,/,
1@@0"AA
:0$+,0;(<"+&0;
!"#$%"
8=>"%*/,?6"(<"+&0;9 !"#$%"
!"#$%"
!"#$%&'
(21"-$9:#3.+;
-$9:#3.+;
()
(*
!"!"!
(+
4/+5-26+.7$'+2-
(#0/7- ,-.-/0$(#120-#30
!6<836=$>32=.3?$@#=63?
!"#$%&'()*+
/
!,- !"#$ !
"
!.- %&'()
/$##0)1 *+,-.
!"#$ %&'()
01!
!"#$"%&'()*+,-,+%.,#/
(#0"+*
!"#$%&$'&$(&$)*
+$+$+
%$,$'$-$(* 122*&345'6%/$0%$*
)$,$%$.$/00* *$12)3$425$%$,$'$-$(
$$$$62%)$$$$$$78&'
$$$$62%)$$$$$$79&(
$$$$%))$$$$$$$78&79
$$$$:#253$$$$$78&%
*$12)3$425$)$,$%$.$/00
$$$$62%)$$$$$$79&,/00
$$$$:;'#5%(#$$78&79
$$$$:#253$$$$$78&)
!"#$%&'()"&*+"*'
,--'./01()"&*+"*'
!"#$%&"'$(")"*"+","-
"""".$)%""""""/01+
"""".$)%""""""/21-
"""")%%"""""""/01/2
!"#$%&'()"&*+"*'
""""34$(&"""""/01) 6766677677667796
6766677676777797
!"#$%&"'$("%"*")"5"677 6767766677667797
"""".$)%""""""/21*677 6766676777667796
""""38+4()-4""/01/2 6766677676777797
""""34$(&"""""/01% 6767766777667797
6766677667667796
!"#$%%%&'()
!"#$%"&'(#)$ !"#$%%%&*(+
#$$%%%%&'(&*
,-"./%%&'(#
*+$,-'(#)$
3454 348< 0100011011001120
:!
3454 0100011010111121
.+,"/+'(#)$
3458 0101100011001121
;7 &"6/''789, 345= 0100010111001120
01+,2$+'(#)$
!"#$%"&'(#)$ :%)>6%?'@+>"%?
!"#$%"&'(#)$'*+,%-$)"#
. !"#$%&'%()"/'0#1$%23$)"#'%,$%),4,5'6%"7
7,7"%8
. *+"$,#"&'%()"/'9:('"+;'7,7"%8'5-$-
%,6,%,#3,;'0<*;',$3=
!"#$#%&'()*+,#-.'/.#'00/,--12
34#$#&,&5/67!"82
)'9.:9';#$#"<=>42
?)*9,@)'9.:9';#+5.#A=BC#D
####,E,(F.,@34C2
####!"#$#!"#G#-*H,5I@3JAB4K"BC2
####34#$#&,&5/67!"82
L2
Common Functions of Interrupts
Applied Operating System Concepts 2.4 Silberschatz, Galvin, and Gagne 1999
Interrupt Handling
Applied Operating System Concepts 2.5 Silberschatz, Galvin, and Gagne 1999
Interrupt Time Line For a Single Process Doing Output
CPU user
process
executing
I/O interrupt
processing
I/O idle
device transferring
Applied Operating System Concepts 2.6 Silberschatz, Galvin, and Gagne 1999
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.
• After I/O starts, control returns to user program without waiting
for I/O completion.
– System call – request to the operating system 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.
– Operating system indexes into I/O device table to determine
device status and to modify table entry to include interrupt.
Applied Operating System Concepts 2.7 Silberschatz, Galvin, and Gagne 1999
Two I/O methods
Synchronous Asynchronous
requesting process
user requesting process user
waiting
hardware hardware
data transfer data transfer
time time
(a) (b)
Applied Operating System Concepts 2.8 Silberschatz, Galvin, and Gagne 1999
Device-Status Table
Applied Operating System Concepts 2.9 Silberschatz, Galvin, and Gagne 1999
Direct Memory Access (DMA) Structure
Applied Operating System Concepts 2.10 Silberschatz, Galvin, and Gagne 1999
Storage Structure
• Main memory – only large storage media that the CPU can
access directly.
• Secondary storage – extension of main memory that provides
large nonvolatile storage capacity.
• Magnetic 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.
Applied Operating System Concepts 2.11 Silberschatz, Galvin, and Gagne 1999
Moving-Head Disk Mechanism
actuator
read-write
track t spindle head
sector s
cylinder c
platter
arm
rotation
Applied Operating System Concepts 2.12 Silberschatz, Galvin, and Gagne 1999
Storage Hierarchy
Applied Operating System Concepts 2.13 Silberschatz, Galvin, and Gagne 1999
Storage-Device Hierarchy
registers
cache
main memory
electronic disk
magnetic disk
optical disk
magnetic tapes
Applied Operating System Concepts 2.14 Silberschatz, Galvin, and Gagne 1999
Hardware Protection
• Dual-Mode Operation
• I/O Protection
• Memory Protection
• CPU Protection
Applied Operating System Concepts 2.15 Silberschatz, Galvin, and Gagne 1999
Dual-Mode Operation
Applied Operating System Concepts 2.16 Silberschatz, Galvin, and Gagne 1999
Dual-Mode Operation (Cont.)
monitor user
set user mode
Applied Operating System Concepts 2.17 Silberschatz, Galvin, and Gagne 1999
I/O Protection
Applied Operating System Concepts 2.18 Silberschatz, Galvin, and Gagne 1999
Memory Protection
Applied Operating System Concepts 2.19 Silberschatz, Galvin, and Gagne 1999
A Base And A limit Register Define A Logical Address Space
monitor
256000
job 1
300040 300040
base register
job 2
420940 120900
limit register
job 3
880000
job 4
1024000
Applied Operating System Concepts 2.20 Silberschatz, Galvin, and Gagne 1999
Protection Hardware
Applied Operating System Concepts 2.21 Silberschatz, Galvin, and Gagne 1999
CPU Protection
Applied Operating System Concepts 2.22 Silberschatz, Galvin, and Gagne 1999
General-System Architecture
• Given the I/O instructions are privileged, how does the user
program perform I/O?
• System call – the method used by a process to request action by
the operating system.
– Usually takes the form of a trap to a specific location in the
interrupt vector.
– Control passes through the interrupt vector to a service
routine in the OS, and the mode bit is set to monitor mode.
– The monitor verifies that the parameters are correct and
legal, executes the request, and returns control to the
instruction following the system call.
Applied Operating System Concepts 2.23 Silberschatz, Galvin, and Gagne 1999
Use of A System Call to Perform I/O
resident
case n
monitor
.
.
1 . 2
trap to perform I/O
read
monitor
.
.
.
3
return
to user
.
.
.
user
system call n program
.
.
.
Applied Operating System Concepts 2.24 Silberschatz, Galvin, and Gagne 1999