Technical difference between "port mapped" and "memory map"?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
LieutenantHacker
Member
Member
Posts: 69
Joined: Sat May 04, 2013 2:24 pm
Location: Canada

Technical difference between "port mapped" and "memory map"?

Post by LieutenantHacker »

I know these are two of the most common ways for I/O in a computer system. What I want to know is what differs this (on the architectural level)?

Like, for example, how is port-mapping something different than memory-mapping on the lowest possible level(is there a different configuration to access it)?

Also, why is there both memory mapping, and port mapping? One is not good enough?
The desire to hack, with the ethics to code.
I'm gonna build an 8-bit computer soon, with this as reference: http://www.instructables.com/id/How-to- ... -Computer/
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Technical difference between "port mapped" and "memory m

Post by Brynet-Inc »

On most platforms, there is no difference. It's all memory mapped.

The I/O bus is a separate legacy address space on x86, you can only access it via the IN and OUT instruction variants.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Technical difference between "port mapped" and "memory m

Post by Love4Boobies »

One difference in the case of x86 is that MMIO operations are asynchronous, whereas operations on the I/O address space are synchronous.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
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: Technical difference between "port mapped" and "memory m

Post by Combuster »

Love4Boobies wrote:MMIO operations are asynchronous
Potentially asynchronous, depending on the whole system of cache controls (paging, MTRR, PAT). You can make it as asynchronous as RAM (Writeback) and as synchronous as port I/O (uncacheable). In practice, you'll find that MMIO to devices is as synchronous as PIO unless you explicitly changed it.
"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 ]
Post Reply