Date: Tue, 15 Jul 2003 13:10:11 -0700 From: John-Mark Gurney <gurney_j@efn.org> To: Stefan Farfeleder <stefan@fafoe.narf.at> Cc: freebsd-ppc@freebsd.org Subject: Re: How to determine amount of RAM installed? Message-ID: <20030715201011.GK35337@funkthat.com> In-Reply-To: <20030715192129.GG574@wombat.fafoe.narf.at> References: <20030715182724.GA70768@dragon.nuxi.com> <20030715192129.GG574@wombat.fafoe.narf.at>
next in thread | previous in thread | raw e-mail | index | archive | help
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."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030715201011.GK35337>