git: kernel - Report actual real memory during kernel boot
Matthew Dillon
dillon at crater.dragonflybsd.org
Tue Sep 28 18:58:18 PDT 2010
commit 1bda0d3d214f53191b6954dd77ba7589b5e23a8a
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Tue Sep 28 18:20:01 2010 -0700
kernel - Report actual real memory during kernel boot
* Calculate and report the actual real memory reported by the BIOS,
only counting memory types and ignoring other mapping types and holes.
* Report this value instead of the highest mapped address, reducing
user confusion. e.g. on a machine with 8G of ram:
real memory = 8858370048 (8448 MB) (before change)
avail memory = 7597334528 (7245 MB)
real memory = 8049428480 (7676 MB) (after change)
avail memory = 7597334528 (7245 MB)
real memory = 8452081664 (8060 MB) (after changing BIOS video 512M->128M)
avail memory = 7987879936 (7617 MB)
This all makes sense if you think about. The MB has on-board video and
the BIOS reserves video memory for it, so after taking that into account
the BIOS is really only eating around 4MB of ram for itself. The
"real memory" now correctly reflects memory remaining after the BIOS
took its cut whereas originally (the 8.4GB) was really more a reflection
of the highest mapped address, memory + IO/bus-space combined, and
did not accurately reflect how much memory the BIOS was handing to the
kernel.
Summary of changes:
sys/platform/pc32/i386/machdep.c | 29 ++++++++++++++++++-----------
sys/platform/pc64/x86_64/machdep.c | 20 ++++++++++++--------
2 files changed, 30 insertions(+), 19 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1bda0d3d214f53191b6954dd77ba7589b5e23a8a
--
DragonFly BSD source repository
More information about the Commits
mailing list