LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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.

Notices

Reply
 
Search this Thread
Old 03-25-2013, 07:46 PM   #1
pokemon168
LQ Newbie
 
Registered: Mar 2013
Posts: 7

Rep: Reputation: Disabled
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.
 
Old 03-25-2013, 10:05 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,230

Rep: Reputation: 1070Reputation: 1070Reputation: 1070Reputation: 1070Reputation: 1070Reputation: 1070Reputation: 1070Reputation: 1070
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.
 
Old 03-26-2013, 06:08 AM   #3
pokemon168
LQ Newbie
 
Registered: Mar 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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.
 
Old 03-26-2013, 06:22 AM   #4
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,457

Rep: Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212
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...
 
Old 03-26-2013, 07:03 AM   #5
pokemon168
LQ Newbie
 
Registered: Mar 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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.
 
Old 03-26-2013, 07:16 AM   #6
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,457

Rep: Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212
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.
 
Old 04-01-2013, 08:05 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 1,978

Rep: Reputation: 512Reputation: 512Reputation: 512Reputation: 512Reputation: 512Reputation: 512
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.
 
Old 04-01-2013, 11:10 AM   #8
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,378

Rep: Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824Reputation: 824
Found this article about memory use in Linux which shows that your customers request goes against Linux design. http://www.ibm.com/developerworks/li...memory-access/

Quote:
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.
 
Old 04-01-2013, 11:40 AM   #9
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 608

Rep: Reputation: 179Reputation: 179
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory map or physical address of some memory allocated by malloc demon007 Programming 1 02-04-2012 06:17 AM
How to properly edit mtrr (Memory Type Range Registers) for 4GB RAM memory Z0K4 Slackware 4 11-07-2011 10:02 AM
Allocate memory to a program before execution codegenie Programming 9 01-27-2011 11:53 AM
why dmesg | grep Memory gives two different physical memory amounts? jstitch Linux - Hardware 1 10-20-2010 11:52 PM
PCIe dma-able memory location in physical memory for Intel Nehalem / Tylersburg arch robvoo Linux - Kernel 4 07-31-2009 06:21 AM


All times are GMT -5. The time now is 02:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration