Memory Mapped vs I/O Mapped Input Output

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory Mapped vs I/O Mapped Input Output

spartacus
I'm currently reading a computer organization book and i'm so confused about Input/Output mechanism and have lots of questions in my mind.

As i understood there are two concepts for communicating with peripherals, first one is Memory Mapped I/O and the other one is I/O(Port) Mapped I/O.If the architecture is based on Memory Mapped I/O there are no special I/O instructions like "in","out" etc and device registers are mapped to memory address space so we can read or write to peripheral ports by "mov" instruction.On the other hand if architecture is based on I/O Mapped I/O, device registers are mapped to I/O address space which is completely separated from memory address space and cpu uses special instructions("in","out","ins","outs" ) for reading or writing to I/O Mapped device registers.

So here is my questions;

1.)If X86 architecture uses I/O(Port,Isolated etc) Mapped I/O technique why there are memory address spaces for devices like graphic card?

2.)If graphic card maps 1 gb memory to main memory address space what does it mean?Does it mean Memory Mapped I/O ?

3.)If x86 architecture doesn't use Memory Mapped I/O how a device can maps itself to memory address space?

4.)If x86 architecture can use Memory Mapped I/O ,how can it use and with which instructions?

5.)If I/O mapping is about mapping peripheral registers why graphic card wants so much space for mapping ?
Reply | Threaded
Open this post in threaded view
|

Re: Memory Mapped vs I/O Mapped Input Output

cadet1620
Administrator
spartacus wrote
1.)If X86 architecture uses I/O(Port,Isolated etc) Mapped I/O technique why there are memory address spaces for devices like graphic card?
Memory mapped and Port I/O are not mutually exclusive. It is often the case that devices that need large amounts of data transfer use Memory Mapped I/O.

I/O ports typically have a much smaller address space than the memory address space, and they usually don't have any built in caching. In the 80386, which was the last x86 I used in a HW design, the I/O address space was 64K bytes.

There is also another I/O mode called DMA (Direct Memory Access) used promarily by disk and tape controllers, where the CPU tells the peripheral where to get or put the data in the RAM address space, and the peripheral periodically steals memory cycles to transfer data to/from RAM under it's command.
2.)If graphic card maps 1 gb memory to main memory address space what does it mean?Does it mean Memory Mapped I/O ?
Yes, but that doesn't mean that it isn't also using I/O ports.
3.)If x86 architecture doesn't use Memory Mapped I/O how a device can maps itself to memory address space?
They're not exclusive. See (1) above.
4.)If x86 architecture can use Memory Mapped I/O ,how can it use and with which instructions?
The hardware design outside of the x86 processor determines what happens with memory addresses. Any instruction that acesses memory can do memory mapped I/O.
5.)If I/O mapping is about mapping peripheral registers why graphic card wants so much space for mapping
Memory mapped I/O is not limited to "registers". The biggest part of the graphic card's memory map is for the screen buffer.

Note that there can be very interesting interactions between the on-chip memory cache and memory mapped I/O. There has to be a way to bypass the cache to ensure that all read and write instructions the I/O device's memory range physically occur to the device and don't get short-circuited by the cache.

--Mark