NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mmap and MAP_FIXED



On 2016-05-12 17:09, Daniel Jour wrote:
Regarding the page / map size: At first I tried this with larger sizes
(around 98 kb), but no difference.


Johnny wrote:
What is the pagesize of the machine?

pagesize yields 4096 on the system in question, so it shouldn't be of
relevance, I guess.

OK. Then yeah, that was not a relevant point here.

Michael wrote:
But the start address in the test program is aligned to something much
larger, so the first test should succeed if that was the problem. I
wouldn't bet on the address range used being available though, but
that's just a hunch.

Why shouldn't the range be available, though? /proc/PID/maps does not
show any mapping in this range. Is there some kernel related mapping
that doesn't show up in /proc/PID/maps?

I think that is hardware dependent. The OS might be somewhere in the address space as well, just not accessible to user mode, for example. I would not expect that to show up in the map. There might also be limitations to what addresses actually can be mapped by the hardware.

Which are additional reasons why it's probably better to let the OS give you an address instead you you trying to pick one. Depending on the hardware, there might actually be different ranges of addresses that you will have issues with.

	Johnny



Home | Main Index | Thread Index | Old Index