1

I'm working in an embedded linux system that allows me to access hardware peripherals through /dev/mem. I'd like to memory map different segments of this file (potentially a few hundred different mmaps). This leads me to the question:

Given enough address space, is there a limit in Linux to the number of times I can memory map different parts of the same file?

Ryan Johnson
  • 102
  • 7
  • 2
    For `mmap` of peripherals into userspace, I don't think you want to use `/dev/mem`. See my answer: [Memcpy performance on /dev/mem outside kernel ram](https://stackoverflow.com/a/37399307/5382650) – Craig Estey Mar 08 '23 at 21:36
  • Why treat them as memory mapped files? Seems like overkill. In all the embedded systems I worked on, the hardware was accessed via pointer. You assign the pointer to the H/W register, then dereference the pointer. Simple. – Thomas Matthews Mar 08 '23 at 22:13
  • @ThomasMatthews: It sounds like your embeded systems had direct memory access, wheras OP seems to maybe be in user mode with virtual memory? – Mooing Duck Mar 08 '23 at 22:50

0 Answers0