FIGURE 11.111.2 Synchronous vs asynchronous I/OSynchronous I/O− In this scheme CPU execution waits while I/O proceedsAsynchronous I/O− I/O proceeds concurrently with CPU execution11.3 Communication to I/O DevicesThe CPU must have a way to pass information to and from an I/O device. There are three approaches available to communicate with the CPU and Device.Special Instruction I/OMemory-mapped I/ODirect memory access (DMA)11.3.1 Special Instruction I/OThis uses CPU instructions that are specifically made for controlling I/O devices. These instructions typically allow data to be sent to an I/O device or read from an I/O device.11.3.2 Memory-mapped I/OWhen using memory-mapped I/O, the same address space is shared by memory and I/O devices. The device is connected directly to certain main memory locations so that I/O device can transfer block of data to/from memory without going through CPU.
FIGURE 11.2While using memory mapped IO, OS allocates buffer in memory and informs I/O device to use that buffer to send data to the CPU. I/O device operates asynchronously with CPU, interrupts CPU when finished.