[SOLVED] Physical address space mapped to MMIO

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Rukog
Member
Member
Posts: 51
Joined: Sun Aug 01, 2021 5:24 pm

[SOLVED] Physical address space mapped to MMIO

Post by Rukog »

In System Programming Guide, Part 1.pdf at 3.3 PHYSICAL ADDRESS SPACE I can read that
This physical address space can be mapped to read-write memory, read-only memory, and memory mapped I/O.
But I see nowhere where can I map MMIO on the physical address space.

Is this a GDT stuff right? but there is no option for that.
Last edited by Rukog on Fri Aug 13, 2021 7:53 am, edited 1 time in total.
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Physical address space mapped to MMIO

Post by nexos »

MMIO appears no different to the CPU then other memory. The address translator takes care of it for you. I assume the Intel manual is being overly verbose here, as MMIO appears the same "read only" memory, or maybe "read / write" memory
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
davmac314
Member
Member
Posts: 121
Joined: Mon Jul 05, 2021 6:57 pm

Re: [SOLVED] Physical address space mapped to MMIO

Post by davmac314 »

Rukog wrote:In System Programming Guide, Part 1.pdf at 3.3 PHYSICAL ADDRESS SPACE I can read that
This physical address space can be mapped to read-write memory, read-only memory, and memory mapped I/O.
But I see nowhere where can I map MMIO on the physical address space.

Is this a GDT stuff right? but there is no option for that.
No. It's not saying you can map it. It's saying it can be mapped.

That is, one a particular system, some particular physical address range might be for memory-mapped I/O. You can't control that range (or maybe you can, by tweaking knobs in the chipset, but that's getting off-topic). But you can't control it via the GDT or page tables.

The GDT is for segment descriptors which controls the mapping of an offset address to a linear address (which may be the same as a physical address, depending on whether paging is active).
Post Reply