With interrupt-driven I/O, the program requesting the transfer is blocked (suspended) while
the bytes are being transferred. The operating system copies the bytes to be transferred into system memory
space so that the suspended program can be temporarily removed from memory, if necessary. Then the OS calls
the ???initiator??? section of the device driver. The initiator moves the first byte into the controller??™s buffer, commands
the controller to begin, and then returns to the OS. The OS then decides which process to execute while waiting
for the I/O to complete.
When the character has been transferred, the controller generates a hardware interrupt. An interrupt causes
the OS to take control. The OS saves the state (register contents, program counter value, etc.) of the currently
executing program, and calls the ???continuator??? section of the driver for the interrupting device. If there are
additional bytes to transfer, the continuator puts the next byte into the controller??™s buffer, commands the
controller to begin again, and returns to the OS. The OS then restores the state and resumes execution of the
other process.
When the last character has been transferred, the continuator will return to the OS, signaling that the
suspended process can be restarted.
Pages:
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271