How do you determine the amount of system memory?

Ben Scott dragonhawk at gmail.com
Tue Jul 29 13:11:31 EDT 2008


On Tue, Jul 29, 2008 at 12:42 PM, Paul Lussier <p.lussier at comcast.net> wrote:
> If they don't match, the test fails, and we know we have a bad kernel.

  Ah, so your actual goal is to test if the the kernel is reporting
memory properly.  So much for workarounds.  :)

  Did you have any luck scrounging up information on the actual bug?

> Ironically, the hardest part of this whole thing has been reliably
> determining the amount of memory in the system :)

  Hmmm.  Thinking about it, this is likely going to be one of those
questions that has more than one viable answer.  Start with actual
RAM.  The video chipset might steal some of it.  Memory-mapped
hardware might shadow some of it.  Maybe the hardware or kernel won't
see it all for other reasons.  Memory regions might be reserved by the
BIOS, and/or by kernel device drivers.  Even assuming you can get all
those numbers, determining which is the "correct" value to compare
against may be non-trivial.

  For example, say you have 1024 MB installed, and you know this
because you queried the SPD's on the actual RAM modules.  But the
kernel is reporting only 1020 MB.  But it turns out the video chipset
is consuming 4 MB for the frame buffer.  Is the kernel "wrong"?

  I expect the kernel bug in question is a bit more obviously wrong.
I'm just pointing out that other factors may make determining the
*right* answer somewhat tricky.

-- Ben


More information about the gnhlug-discuss mailing list