codeblog code is freedom — patching my itch

September 27, 2007

stupid BIOS tricks to find your 4G of RAM

Filed under: Ubuntu — kees @ 7:36 am

A few months ago I upgraded my system to 4G of RAM. Blinded by my shiny new DIMMs, I never actually looked at the output of “free”. All I saw was that the system-monitor applet now showed lots of free memory. Only recently did I notice that I only had 3G of RAM, instead of my expected 4G. This is a rather common problem when running a 32bit OS, but I’ve been running 64bit for a while now. In fact, since it’s such a common complaint for 32bit OSes, I didn’t have any luck Googling for an answer. I did find references to chipset limitations (motherboards with only a 32bit memory bus), but “lshw” seemed to think I was okay. I had 4 banks each showing:

*-bank:0
description: DIMM DDR Synchronous 333 MHz (3.0 ns)

size: 1GB
width: 64 bits
clock: 333MHz (3.0ns)

On reboot, I also noted that my BIOS said I only had 3G. I started to get worried, but managed to find a setting on my Northbridge for Memory to enable “Hardware memory hole”. After that, both the BIOS and Linux were happy and seeing the full 4G. I assume the BIOS just bumps the memory in the 3G region to above 4G, which makes for a silly kernel message:

[ 24.617275] Memory: 3977852k/5259264k available (2281k kernel code, 150272k reserved, 1182k data, 300k init)

But I don’t care. :) It works now, and my “free” output makes me happy again:

             total       used       free     shared    buffers     cached
Mem:       3986156    3958396      27760          0      68268    2949472
-/+ buffers/cache:     940656    3045500
Swap:      3903672      38676    3864996

© 2007, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 License.
CC BY-SA 4.0

4 Comments

  1. Kees,

    Are you by running on a Dell laptop? I bought the extra 2 Gigs of RAM for my Dell Latitude D820 as the BIOS, Chipset, and Dell says you can run 4 Gigs of RAM, but the BIOS is only showing 3.2 Gig avaiable.

    Just curious if that was your problem and if I could use the same trick to get up to the full 4 gig

    Comment by Jonathan — September 27, 2007 @ 8:16 am

  2. This was on my ASUS A8N-VM. If you’re running the i386 kernel, I think there’s no way around the problem. However, if you’ve got the amd64 kernel, yeah, see if there are some BIOS options for it.

    Comment by kees — September 27, 2007 @ 8:29 am

  3. I had the same problem with Windows (32bit and 64bt) on my ASUS P5B Deluxe, there was a memory remap feature that I had to turn on to get the BIOS to see 4 GB of ram. Also to get 64bit XP to see 4 gigs of ram. XP 32bit only saw 2 GB, unless I turned that BIOS feature off, then the BIOS and XP 32bit saw 3 GB.

    Supposedly PAE (on linux or windows) can get around this. I know at work here we have some gentoo servers that are 32bit that can see 4 GB of ram no problem, they have the PAE options enabled in the kernel. I could not get PAE to work on 32bit XP though.

    Comment by Edgeman — September 27, 2007 @ 9:03 am

  4. 32-bit Windows clients are artificially limited to 4G to avoid issues with crap drivers so it doesn’t matter if PAE is enabled or not, it’ll never be able to see the full 4G of memory but 32-bit Windows Server and above are fine. And a 32-bit Linux kernel with PAE and HIGHMEM64G enabled will be fine as well.

    Comment by Jim — September 28, 2007 @ 11:31 am

Powered by WordPress