Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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.
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.
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...