Re: Mapping logical to physical memory addresses
Re: Mapping logical to physical memory addresses
- Subject: Re: Mapping logical to physical memory addresses
- From: Mike Smith <email@hidden>
- Date: Sun, 5 Mar 2006 12:04:20 -0800
On Mar 5, 2006, at 11:21 AM, Tony Scaminaci wrote:
Is there a system command or kernel call that returns the physical
address corresponding to the logical address allocated by malloc?
Not for a user-space application.
In my code, I first do a malloc for all of the free physical ram
followed by mlock.
mlock will not necessarily allow you to wire all available memory
into your application, since the system requires a certain amount of
free memory in order to operate.
How do you determine the amount of "free physical RAM"?
Because I'm only allocating from the free physical ram pool, all
allocated memory resides in ram (which it must for a memory test
application).
This assumes a very naive model for your RAM test application, and
one that cannot be supported by a modern operating system while running.
However, the start address returned by malloc is a local address
which I can't figure out how to map to the physical DIMM. If I run
two instances of the program at the same time and allocate half the
free ram to each instance, both instances have the same local start
address. How does one figure out the physical address corresponding
to these local addresses returned by malloc?
You don't.
Also, I'm under the impression that the memory manager doesn't run
in single-user mode. Does that mean that these local addresses are
really physical addresses in single-user mode?
You're mistaken.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden