Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • By the definition quoted in the question, the framebuffer counts as memory-mapped I/O space. So there's another mmap() possibility. Commented Oct 16, 2018 at 14:16
  • Thanks. Does MMIO map controller's registers and memory to virtual memory addresses or physical memory addresses? Does MMIO involve virtual memory, or just physical memory? Commented Oct 17, 2018 at 0:28
  • The advantage of memory mapped file over standard IO system calls is to avoid copying from kernel cache/buffer to userspace buffer. Is the advantage of MMIO over port I/O also similar? Commented Oct 17, 2018 at 0:38
  • MMIO, viewed from the CPU’s perspective, is based on physical addresses, which can be mapped to virtual (linear) addresses if necessary. Viewed from the device’s perspective, it uses physical addresses, unless an IOMMU is involved. /dev/mem uses physical addresses only. Commented Oct 17, 2018 at 12:22
  • For MMIO you definitely want to avoid caches ;-). However the main advantage of MMIO over port I/O is that the number of available ports is small, and that accessing other devices’ memory using port I/O would be prohibitively slow (think of multi-gigabyte GPUs). Commented Oct 17, 2018 at 12:24