Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Feb 2000 18:02:48 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Mark Ovens <mark@dogma.freebsd-uk.eu.org>
Cc:        Omachonu Ogali <oogali@intranova.net>, freebsd-questions@freebsd.org
Subject:   Re: CPU Information
Message-ID:  <20000217180248.E21720@fw.wintelcom.net>
In-Reply-To: <20000218011519.A329@marder-1>; from mark@dogma.freebsd-uk.eu.org on Fri, Feb 18, 2000 at 01:15:19AM %2B0000
References:  <Pine.BSF.4.10.10002171902350.96234-100000@hydrant.intranova.net> <20000217164929.D21720@fw.wintelcom.net> <20000218011519.A329@marder-1>

next in thread | previous in thread | raw e-mail | index | archive | help
* Mark Ovens <mark@dogma.freebsd-uk.eu.org> [000217 17:43] wrote:
> On Thu, Feb 17, 2000 at 04:49:29PM -0800, Alfred Perlstein wrote:
> > * Omachonu Ogali <oogali@intranova.net> [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 <oogali@intranova.net>
> > >  */
> > ...
> > > 
> > > 	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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000217180248.E21720>