Block Input/Output device: In a block I/O device information is stored in blocks of fixed size. Every block has an address of its own. Examples of block Input/Output device include hard disk drives and CO-ROMs.
Character Input/Output device: In a character Input/Output device, information is sent or received as a stream of characters. They don’t have a block structure and there are no addresses involved. Examples of charcater Input/Output device include mouse and printer.
A device controller uses control registers or data buffers for interacting with the CPU. Whenever an action needs to be performed for the device data instructions are written on the control registers or data buffers. Also, by reading the control registers or data buffers the state of a particular device can be found. CPU can communicate with the control registers or data buffers by using any one of the below given methods:
1) Separate address space for I/O and memory: In this method, an I/O port number is assigned to each control register. These I/O ports are protected so that they can be used only by the operating system. I/O instructions are used for reading and writing in the registers. Assembly code is required for this method to work.
2) Memory Mapped I/O: In this method, control registers are mapped in to memory space. Here, a unique memory address is assigned to each control register. Assembly code is not required in memory mapped I/O. In this method, there is no protection mechanism required as in method-1. In this case, the operating system simply doesn’t put address spaces containing control registers in a virtual address space of a user.