MysteriousWaffle
MysteriousWaffle

Reputation: 481

How are memory mapped devices allocated an address and how does the CPU know what it is

I gather that the main ways of the CPU addressing devices are "port" and "memory" mapped.

In both of these:

Realise this might be a lot in one go but thanks in advance!

Upvotes: 1

Views: 718

Answers (1)

pio
pio

Reputation: 540

In general, CPU does not know that a specific address is a memory mapped.

it's SW responsibility (BIOS/drivers mainly) to put define the address range as uncacheable (so each read/write will go through to the device and not held internally until WB), out of the core there is some mapping that redirect specific addresses to a device rather than to the DDR (memory).

short answers to part of your bullets (I'm not sure I understand all the questions):

  • How are devices dynamically assigned an address - who assigns it and how?

    Either BIOS define such ranges (the driver communicates on a new device to the BIOS, BIOS save some addresses for plug and play devices)

  • How does the CPU then know a device exists, has been assigned and what the address is, particularly its running programs? (how does this work both if the computer is on and off)

    The CPU doesn't know that, these addresses are treated as normal uncacheable addresses.

  • Is it fair to say that Memory Mapped is the dominant approach in modern systems?

    Yes, it's easier to treat it just another place in memory (it also a bit faster).

Upvotes: 1

Related Questions