kernel - Report actual real memory during kernel boot
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 29 Sep 2010 01:20:01 +0000 (18:20 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 29 Sep 2010 01:20:01 +0000 (18:20 -0700)
commit1bda0d3d214f53191b6954dd77ba7589b5e23a8a
tree6fbe7ddeea65cb3da39877e73a786b792f4e9ba0
parent906c754ce7d9e9b435f77dba229ad08f65d2ea4a
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.
sys/platform/pc32/i386/machdep.c
sys/platform/pc64/x86_64/machdep.c