Department of Computer Science
Course: CS 3725
Horizontal Bar

next up gif
Next: An example I/O system Up: Input-Output Architecture Previous: Direct memory access

The I/O address space

Some processors map I/O devices in their own, separate, address space; others use memory addresses as addresses of I/O ports. Both approaches have advantages and disadvantages. The advantages of a separate address space for I/O devices are, primarily, that the I/O operations would then be performed by separate I/O instructions, and that all the memory address space could be dedicated to memory.

Typically, however, I/O is only a small fraction of the operations performed by a computer system; generally less than 1 percent of all instructions are I/O instructions in a program. It may not be worthwhile to support such infrequent operations with a rich instruction set, so I/O instructions are often rather restricted.

In processors with memory mapped I/O, any of the instructions which references memory directly can also be used to reference I/O ports, including instructions which modify the contents of the I/O port (e.g., arithmetic instructions.)

Some problems can arise with memory mapped I/O in systems which use cache memory or virtual memory. If a processor uses a virtual memory mapping, and the I/O ports are allowed to be in a virtual address space, the mapping to the physical device may not be consistent if there is a context switch. Moreover. the device would have to be capable of performing the virtual-to-physical mapping. If physical addressing is used, mapping across page boundaries may be problematic.

If the memory locations are cached, then the value in cache may not be consistent with the new value loaded in memory. Generally, either there is some method for invalidating cache that may be mapped to I/O addresses, or the I/O addresses are not cached at all. We will look at the general problem of maintaining cache in a consistent state (the cache coherency problem) in more detail when we discuss multi-processor systems.


next up gif
Next: An example I/O system Up: Input-Output Architecture Previous: Direct memory access

Paul Gillard
Mon Nov 24 20:44:06 NST 1997