Figuring out physical memory regions from a kernel module

From: Hanson, Jonathan M
Date: Wed Dec 08 2004 - 12:46:15 EST

Is there a reliable way to tell from a kernel module (currently
written for 2.4 but will need to work under 2.6 in the future) which
regions of physical memory are actually available for the kernel and
processes to use? For example, the following command tells me the
regions of physical memory that are available to use:

cat /proc/iomem | grep 'System RAM'

This yields something like the following on my x86 system:

00000000-0009ffff : System RAM
00100000-1ffd5857 : System RAM

I need to be able to determine these regions from within a kernel
module. The e820 data structures configured at kernel boot-time are not
exported so I can't see them from a kernel module, otherwise they would
be perfect. For my purposes, I'm operating under the assumption that all
physical memory can be mapped by the kernel (under 896 MB of physical
memory). Can anyone recommend a way to get to this data? I would greatly
appreciate it.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at