This memory detection code is now part of the baseline Linux kernels, so this page is obsolete unless you’re running a really old version of the kernel.
In days gone by, Linux would only detect up to 64mb of memory (because
it only used the BIOS service int 15h, ah=088h
. This didn’t
use to be a problem, because no mortal could afford 64mb of memory,
but that, um, changed. I was working on machines with more than
64mb fairly early on, so I was constantly patching memory sizes in.
Eventually I snapped and started writing better a memory detection
system for Linux (which eventually found its way into the baseline kernel.)
I started putting patches
into the McAfee WebShield kernels starting
with Linux 1.2.13, and eventually got around to sending Linus a copy
of a 2.1.x patch at around 2.1.23, with a fixed version at 2.1.46.
Unfortunately, I picked int 15h, ax=0e801h
as the BIOS service
to use, and the rest of the world
decided to standardize on int 15h,
ax=0x820h
. So I had to go back to the shops and rework the patch
to use that one.
This patch uses the BIOS services int 15h, ax=0e820h
, int 15h,
ax=0e801h
, and int 15h, ah=088h
to get the memory size.
E820
is allegedly the memory detection scheme that Microsoft®
Windows® uses to detect memory, so it should be pretty universal on
modern BIOSes. E801
used to be pretty widely used, but it appears
to be falling into disuse on modern BIOSes. 88
is ancient and
clunky and not described very well, so vendors can return most anything
they want (either 16mb or 64mb max) when the amount of memory gets too
large.
E820
, or when the user specifies memory via the traditional
mem=Xxx
, memory regions are fabricated for the memory
init routines to handle.E820
, but which does not support memory
regions) for 1.2.13. Alas, time moves on and I no longer use
1.2.13 on very many systems, so it’s fairly likely this is the
last patch I’ll do for this version of the Linux kernel.The full-blown memory patch against kernel 2.3.15; it is a
fairly heavy reworking of the memory patch because of suggestions
from Linux Torvalds on how the patch might work better (not
exactly in those words). In this patch, the whole world
becomes memory regions, and on bioses that don’t support
E820
, or when the user specifies memory via the traditional
mem=Xxx
, memory regions are fabricated for the memory
init routines to handle.
And this patch has the vitally important side-effect of minimizing the additional assembly language needed by the kernel.
E820
, but which does not support memory
regions) for 1.2.13. Alas, time moves on and I no longer use
1.2.13 on very many systems, so it’s fairly likely this is the
last patch I’ll do for this version.A memory detection patch for Linux version 2.0.30. This is the second generation of my enhanced memory detection code, which will hopefully cooperate better with loadlin.
This patch is newmem.2027 and [newmem.2028-2] (newmem.2028-2) put together, and should also work against versions 2.0.27 through 2.0.29 (McAfee’s WebShield used this patch in its 2.0.28-based kernel.)
The 2.2.1 version of the E820
patch.
It works on the single machine I’ve tested it on (though 2.2.1 broke enough interfaces so that nothing ELSE works on that machine with a 2.2.1 kernel in place) and I welcome feedback from other people who wish to test it.
E820
memory patch. This one
properly handles memory holes, so it can be used on systems
with memory-mapped accelerated video cards.