user247763
user247763

Reputation: 261

Are the memory mapped IO address(es) of a device mapped to the kernel space of a process?

Say that I have a device that uses memory mapped IO.

And we know that in Linux, each process have 3 GB of user space, and 1 GB of kernel space.

Now I assume that the address(es) for this device will be mapped to the kernel space of a process, so that a process (which is running in user mode) cannot access the device. Am I correct?

Upvotes: 0

Views: 494

Answers (1)

user149341
user149341

Reputation:

Now I assume that the address(es) for this device will be mapped to the kernel space of a process, so that a process (which is running in user mode) cannot access the device. Am I correct?

Mostly. Since devices exist in physical memory, they can be mapped to multiple virtual addresses. An appropriately privileged userspace application can use mmap() on /dev/mem to remap portions of I/O memory into its address spce.

Upvotes: 5

Related Questions