From owner-freebsd-ppc@FreeBSD.ORG Tue Jul 15 13:10:33 2003 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7841B37B404; Tue, 15 Jul 2003 13:10:33 -0700 (PDT) Received: from mail.cyberonic.com (mail.cyberonic.com [4.17.179.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3126E43FB1; Tue, 15 Jul 2003 13:10:32 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (node-40244c0a.sfo.onnet.us.uu.net [64.36.76.10]) by mail.cyberonic.com (8.12.8/8.12.5) with ESMTP id h6FKbvcU015120; Tue, 15 Jul 2003 16:37:57 -0400 Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.9/8.11.6) id h6FKABgw040647; Tue, 15 Jul 2003 13:10:11 -0700 (PDT) (envelope-from jmg) Date: Tue, 15 Jul 2003 13:10:11 -0700 From: John-Mark Gurney To: Stefan Farfeleder Message-ID: <20030715201011.GK35337@funkthat.com> References: <20030715182724.GA70768@dragon.nuxi.com> <20030715192129.GG574@wombat.fafoe.narf.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030715192129.GG574@wombat.fafoe.narf.at> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: freebsd-ppc@freebsd.org Subject: Re: How to determine amount of RAM installed? X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 20:10:33 -0000 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."