-   Linux - General (
-   -   physical memory range for program execution (

pokemon168 03-25-2013 07:46 PM

physical memory range for program execution
I have some user programs in media storage that need to be executed in DRAM. When executed, is it possible to control/specify where the program will be executed in "physical" DRAM memory? I want certain programs that I invoke to only be allowed to execute in a specific physical memory region.

sundialsvcs 03-25-2013 10:05 PM

As far as I have ever been aware, "no." Physical RAM is carved-up into "page frames" and each program's active virtual-memory pages are placed there as Linux's virtual memory manager sees fit.

pokemon168 03-26-2013 06:08 AM

Is it possible then to create a ram disk using something like mkfs and somehow specifying from which physical memory range the ram disk is to be created from? If this is possible, then the executables can then be copied into this ram disk before running them.

pan64 03-26-2013 06:22 AM

yes, probably, but why? executables copied into ram before executing (not the whole file, but parts). shared libs are also stored in the memory and all the apps are using them from memory...

pokemon168 03-26-2013 07:03 AM

It is from a customer's request to run something at a specific physical memory range. How does one setup/create the ram disk for a specific physical memory range then? Thanks.

pan64 03-26-2013 07:16 AM

I do not know if it was possible at all, but probably tmpfs is a better solution. the kernel handles it, you do not need to take care about its size and place at all.

jpollard 04-01-2013 08:05 AM

You can't.

Each time you run an executable it will be allocated memory as memory is available. Once started you CAN lock memory, but you won't know where that physical memory is. Drivers MAY get the physical memory address for the purpose of device data transfer, but not always - there are things like MMIO units that work just like the memory management of the CPU - and it hides the actual physical memory from the device.

And you can't know ahead of time which environment you are in.

allend 04-01-2013 11:10 AM

Found this article about memory use in Linux which shows that your customers request goes against Linux design.


The mmap function allows a user space application to create a mapping in the virtual address space. This functionality is common in certain classes of device drivers (for performance), allowing physical device memory to be mapped into the virtual address space of the process.
It will not allow mappimg to a specific physical memory range. From a security point of view, this is a good thing.

414N 04-01-2013 11:40 AM

Maybe I misunderstood OP question and facts, but is the machine where the program should run sporting different types of RAM, where DRAM would be the most "desirable" one?
If so, I think that's an unconventional setup for a PC machine, unless we're talking of a special purpose machine...

All times are GMT -5. The time now is 03:09 PM.