How to determine amount of RAM installed?
John-Mark Gurney
gurney_j at efn.org
Tue Jul 15 13:10:33 PDT 2003
Stefan Farfeleder wrote this message on Tue, Jul 15, 2003 at 21:21 +0200:
> On Tue, Jul 15, 2003 at 11:27:24AM -0700, David O'Brien wrote:
> > How can one get RAM properties from OBP? Specifically how much RAM is
> > installed?
>
> dev /memory
> .properties
>
> The first value of 'available' should be the start address, the second
> one the number of bytes of installed memory.
Ok, this is a start but not very useful (esspecially wrt 64bit ppc)..
To properly parse the reg or available property, you need to get the
#address-cells and #size-cells property from the parent node. If the
address-cells doesn't exist, assume it to be 2, and if the size-cells
property doesn't exist, assume it to be 1.
The available property is memory that hasn't been allocated by the OFW,
and reg is the absolute physical memory.
So, on a g3 notebook, you have something like:
0 > dev / ok
0 > .properties
[...]
#address-cells 00000001
#size-cells 00000001
[...]
ok
0 > dev /memory ok
0 > .properties
[...]
reg 00000000 04000000
04000000 10000000
available 00003000 13dfd000
and a cell is defined as 4 bytes. So, you can see where the memory is
and the size of it. The first 0x3000 bytes of memory is currently used
by OFW, with 0x13dfd000 memory available.
--
John-Mark Gurney Voice: +1 415 225 5579
"All that I will do, has been done, All that I have, has not."
More information about the freebsd-ppc
mailing list