Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2006 11:52:46 +0100
From:      Valerio daelli <valerio.daelli@gmail.com>
To:        freebsd-alpha@freebsd.org
Subject:   Error in sysctl realmem on alpha
Message-ID:  <27dbfc8c0602140252o6ae09399taaedac8266c09c64@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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   =20
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  =3D 265486336 (253 MB)
avail memory =3D 250503168 (238 MB)

Maybe everything is due to a shift of 13 bits in
/usr/src/sys/alpha/alpha/machdep.c:

realmem =3D 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 =3D 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

Valerio Daelli



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