Error in sysctl realmem on alpha

John Baldwin jhb at freebsd.org
Tue Feb 14 06:50:28 PST 2006


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 at 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 at webgate.ifom-firc.it:/usr/src/sys/alpha
>
> It looks like the sysctl of realmem is a bit to high:
>
> root at 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 at 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 at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-alpha mailing list