7.2 Peripheral Supplementary
Download
Report
Transcript 7.2 Peripheral Supplementary
7.2 Peripheral Supplementary
From the view of OS to see interrupt
Reference
Silberschatz, Galvin, Gagne, “Operating System Concepts (sixth
edition)”, John Wiley and Sons, INC
Interrupt-driven system
The OS may support the interrupt requests
to control the devices of the system
Interrupt Driven System
If there are
no processes to execute,
no I/O devices to service,
and no users to whom to respond,
Then, an OS will sit quietly, waiting for something to
happen.
Events are almost always signaled by the occurrence of an
interrupt or a trap(or exception), which is a softwaregenerated interrupt caused either by an error or by a
specific request from a user program.
Interrupt-driven system
The occurrence of an event is usually signaled by
an interrupt from either the hardware or the
software.
Hardware (device) may trigger an interrupt at any
time by sending a signal to the CPU usually by
system bus.
Software may trigger an interrupt by executing a
special operation called a system call.
Device-status table
In OS aspect, it is necessary to handle those
I/O devices currently.
The OS uses a table contain an entry for
each I/O device.
Each table entry indicates the device’s type,
address, and state (functioning, idle or busy)
Device-status table
Device 1
Status
Device 2
Status
Request for laser printer
Address: 123456
Length: 1234
Device 3
Status
Device 4
Status
Request for disk1
File:XXX
Operation: read
Address: 123
Length:333
Request for disk1
File:XXX
Operation: write
Address: 123
Length:333