Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2006 09:49:30 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-alpha@freebsd.org
Subject:   Re: Error in sysctl realmem on alpha
Message-ID:  <200602140949.31367.jhb@freebsd.org>
In-Reply-To: <27dbfc8c0602140252o6ae09399taaedac8266c09c64@mail.gmail.com>
References:  <27dbfc8c0602140252o6ae09399taaedac8266c09c64@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 14 February 2006 05:52, Valerio daelli wrote:
> Hi
> we have an AlphaServer DS10 with FreeBSD 5.4 with 256Mb of RAM.
>
> root@webgate:~ uname -a
> FreeBSD webgate.ifom-ieo-campus.it 5.4-RELEASE-p8 FreeBSD
> 5.4-RELEASE-p8 #0: Thu Nov 17 13:13:48 CET 2005
> eldon@webgate.ifom-firc.it:/usr/src/sys/alpha
>
> It looks like the sysctl of realmem is a bit to high:
>
> root@webgate:~ sysctl -a|egrep '(real|phys|user)mem'
> hw.physmem: 265486336
> hw.usermem: 225648640
> hw.realmem: 2174864064512
>
> but the realmem of dmesg is right
>
> root@webgate:~ dmesg |grep mem
> real memory  = 265486336 (253 MB)
> avail memory = 250503168 (238 MB)
>
> Maybe everything is due to a shift of 13 bits in
> /usr/src/sys/alpha/alpha/machdep.c:
>
> realmem = alpha_ptob(Maxmem)
>
> and the realmem is again shifted 13 bits (so it is shifted twice
> instead of once) in /usr/src/sys/kern/kern_mib.c:
>
> val = ctob(realmem);
>
> Sorry I am not really sure I am not so strong in C and kernel
> programming is a bit far from my knowledge.
> Thanks

Your diagnosis appears correct.  I'll fix it shortly.  Thanks!

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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