On 5/15/21 9:17 PM, Alessandro Pistocchi wrote:
Hi all,
is there any way in openbsd to allocate contiguous memory pages in user
space?

Thanks,
A
mmap(2) will give you a block of contiguous virtual pages
mlock(2) will lock them down

The OS tries very hard to conceal physical page addresses
from a user program. There are a number of security attacks
via the virtual memory system which the OS is designed to mitigate.

The physical address of allocated memory is entirely
controlled by the VM system.

Some I/O devices require contiguous physical pages or memory
in a particular region.

In all other cases the physical address of a page doesn't matter,
can't be determined and can be reallocated.

Without more information about your application it's impossible
to give a more complete answer.

Geoff Steckel

Reply via email to