Devices may be categorized as character devices or block devices. A keyboard
is a character device, and a disk is a block device. A character device transfers a character (8 bits) at a time, and
a block device transfers a buffer, or set of data, at a time.
Other examples of character devices include telephone modems and simple terminals. Other examples of
block devices include CD-ROM drives, magnetic tape drives, network interfaces, sound interfaces, and blocks
of memory supporting devices like displays. Character devices interrupt on each character (8 bits) transferred,
and block devices interrupt only when the entire block has been transferred.
Modern computer designs usually include a facility called direct memory access (DMA) for use with block
devices. The DMA controller is its own special computer with access to memory, and it shares access to main
memory with the CPU. DMA moves data directly between the buffer in the I/O controller and main memory,
and it does so without requiring any service from the CPU.
Block devices can be used without DMA and, when they are used that way, the practice is called
???programmed I/O with interrupts.??? With programmed I/O, the block device interrupts when the buffer is ready,
but the operating system must still use the CPU to move the data between the buffer on the I/O controller and
the destination in main memory.
Pages:
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120