memory mapped i/o

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
siavoshkc
Member
Member
Posts: 40
Joined: Wed Feb 19, 2014 11:10 am

Re: memory mapped i/o

Post by siavoshkc »

As I know no device sends data to CPU. They write data to a known location and will signal the CPU somehow (or not) to read from that location. This location is accessed by CPU via I/O bus or Memory bus depending on the device and configuration.

I think these links would be very helpful:
http://en.wikipedia.org/wiki/Memory-mapped_I/O
http://www.cs.umd.edu/class/spring2003/ ... apped.html
Check out my FSB Data Integrity Tester at http://fsbdit.sourceforge.net/.

Siavosh
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: memory mapped i/o

Post by Combuster »

As I know no device sends data to CPU.
You missed the obvious ones: the interrupt controllers.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
siavoshkc
Member
Member
Posts: 40
Joined: Wed Feb 19, 2014 11:10 am

Re: memory mapped i/o

Post by siavoshkc »

Combuster wrote:
As I know no device sends data to CPU.
You missed the obvious ones: the interrupt controllers.
Doesn't it just signal the processor? Or maybe you could say because it includes a number it is counted as data?
Check out my FSB Data Integrity Tester at http://fsbdit.sourceforge.net/.

Siavosh
icealys
Member
Member
Posts: 60
Joined: Mon Feb 17, 2014 3:54 pm

Re: memory mapped i/o

Post by icealys »

ii) address decode logic maps the address to a chip select which tells a bus device that the CPU is talking to it
I think I understand that but what sends instructions do the address decoder?
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: memory mapped i/o

Post by Nable »

icealys wrote:
ii) address decode logic maps the address to a chip select which tells a bus device that the CPU is talking to it
I think I understand that but what sends instructions do the address decoder?
There are no instructions there, just bits of address. You can read about demultiplexer ICs (for example, 74LS138), they receive part of the address as an input and on the output only one pin is active, those with the number equal to digits on the input (i.e. if inputs equal to 000 (binary), then output0 pin will be active, if 001 - then output1 and so on).
Look, here's the second link found by google, it has some nice pictures: http://www.ece.unm.edu/~jimp/310/slides ... mory2.html
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: memory mapped i/o

Post by SpyderTL »

Of course, none of the physical details matter to the OS. From the software's point of view, there are really only two ways to communicate with anything outside of the CPU: memory (MOV instruction) and I/O (IN/OUT instructions).

When the CPU executes one of these instructions, it reads or writes to its memory or I/O port, and the motherboard routes the connection to the appropriate device (memory, keyboard, controllers, PCI bus, etc.)
Post Reply