7.2 peripheral supplementary from the view of os to see interrupt

7
7.2 Peripheral Supplementary From the view of OS to see interrupt

Upload: hector-lucas

Post on 04-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 7.2 Peripheral Supplementary From the view of OS to see interrupt

7.2 Peripheral Supplementary

From the view of OS to see interrupt

Page 2: 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

Page 3: 7.2 Peripheral Supplementary From the view of OS to see interrupt

Interrupt-driven system The OS may support the interrupt requests

to control the devices of the system

Page 4: 7.2 Peripheral Supplementary From the view of OS to see interrupt

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 software-generated interrupt caused either by an error or by a specific request from a user program.

Page 5: 7.2 Peripheral Supplementary From the view of OS to see interrupt

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.

Page 6: 7.2 Peripheral Supplementary From the view of OS to see interrupt

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)

Page 7: 7.2 Peripheral Supplementary From the view of OS to see interrupt

Device-status table

Device 1Status

Request for laser printerAddress: 123456Length: 1234

Device 4Status

Device 2Status

Device 3Status

Request for disk1File:XXXOperation: readAddress: 123Length:333

Request for disk1File:XXXOperation: writeAddress: 123Length:333