From owner-freebsd-questions Thu Feb 17 17:36: 7 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 003EE37B6FE for ; Thu, 17 Feb 2000 17:36:03 -0800 (PST) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) id SAA25980; Thu, 17 Feb 2000 18:02:48 -0800 (PST) Date: Thu, 17 Feb 2000 18:02:48 -0800 From: Alfred Perlstein To: Mark Ovens Cc: Omachonu Ogali , freebsd-questions@freebsd.org Subject: Re: CPU Information Message-ID: <20000217180248.E21720@fw.wintelcom.net> References: <20000217164929.D21720@fw.wintelcom.net> <20000218011519.A329@marder-1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000218011519.A329@marder-1>; from mark@dogma.freebsd-uk.eu.org on Fri, Feb 18, 2000 at 01:15:19AM +0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Mark Ovens [000217 17:43] wrote: > On Thu, Feb 17, 2000 at 04:49:29PM -0800, Alfred Perlstein wrote: > > * Omachonu Ogali [000217 16:41] wrote: > > > Here's a simple app to display the CPU information on a FreeBSD machine. > > > I hope it helps anyone... > > > > It's nice, but output is incorrect, the convertions from normal numbers > > to MB should be done via powers of 2 not powers of 10. > > > > You mean s/1000000/1048576/g ? Are you sure? hrm, pretty sure.. ~ % dmesg | grep memory real memory = 536858624 (524276K bytes) avail memory = 516968448 (504852K bytes) .(21:33:51)(bright@thumper) ~ % bc bc 1.05 Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 536858624 / 1048576 511 ok, so my roms and memory mapped devices take 384k... putting it just below 512MB.. ~ % dmesg | grep memory real memory = 536858624 (524276K bytes) avail memory = 516968448 (504852K bytes) ~ % sysctl -a | grep mem | grep hw hw.physmem: 533716992 hw.usermem: 428204032 ugh! nothing matches up, the box has 512MB, now i'm confused... the calculations for dmesg's idea seem right considering that I'm pretty sure my first 1 meg is overlapped by roms and memory mapped IO devices taking away a couple hundred k, but why is hw.physmem < "real memory"? *boggle* I'll look at the source later to try figure it out. -Alfred > > As posted on a K6-233, 64MB: > > # ./cpuinfo > FreeBSD CPU Information > Version 0.1 > http://tribune.intranova.net > > Architecture: i386 > Number of CPUs: 1 > CPU Model: AMD-K6tm w/ multimedia extensions > CPU Speed: 233MHz > Total Memory: 63MB > User Memory: 43MB > > After s/1000000/1048576/g : > > # ./cpuinfo > FreeBSD CPU Information > Version 0.1 > http://tribune.intranova.net > > Architecture: i386 > Number of CPUs: 1 > CPU Model: AMD-K6tm w/ multimedia extensions > CPU Speed: 223MHz > Total Memory: 60MB > User Memory: 41MB > > > > Why not submit it as a port? > > > > -Alfred > > > > > > > > > > --- snip --- > > > /* > > > * FreeBSD CPU Information 0.1 > > > * --------------------------- > > > * Simple program to display the total RAM, and CPU information. > > > * Compile: cc -o cpuinfo cpuinfo.c > > > * --------------------------- > > > * Omachonu Ogali > > > */ > > ... > > > > > > totalmem = (totalmem - 1000000) / 1000000; > > > usermem = (usermem - 1000000) / 1000000; > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-questions" in the body of the message > > -- > Microsoft: Where do you want to go today? > Linux: Where do you want to go tomorrow? > BSD: Are you guys coming, or what? > -Poster at LinuxWorld 2000 > ________________________________________________________________ > FreeBSD - The Power To Serve http://www.freebsd.org > My Webpage http://ukug.uk.freebsd.org/~mark/ > mailto:mark@ukug.uk.freebsd.org http://www.radan.com -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message