<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi,<br>
<br>
I'm little confused about amount of RAM memory in my computer and I
can't figure out where disappear about 1GB memory. I need yours help
to explain this, because i can't sleep :). Here is background:<br>
<br>
I've plugged into my computer 2x2GB RAM. In BIOS screen i see:<br>
<br>
Amount of available RAM: 4096MB<br>
<br>
so BIOS recognizes all 4GB, but my OS(<b>32bit</b>)<br>
<br>
<small>uname -a<br>
Linux lpt 2.6.33.1 #1 SMP Thu Mar 18 23:32:41 CET 2010 i686
GNU/Linux</small><br>
<br>
sees only 3014MB<br>
<br>
<small>free -m<br>
total used free shared buffers
cached<br>
Mem: <b>3014</b> 1756 1258 0
456 918<br>
<br>
</small>first, i thought that most of this missing memory is not
available because of mapped IO, so i decided to count this by using
addresses from /proc/iomem (where the actual memory map is). I've
wrote piece of code like this to count all memory seen by OS:<br>
<br>
<small>for i in `cat /proc/iomem | grep -P "^[^\s]" | awk '{ print
$1}' | sort | uniq`; do startAddr=$(echo $i | awk -F "-" '{print
$1}') && endAddr=$(echo $i | awk -F "-" '{print $2}');
bytes=$(calc "(0x$endAddr-0x$startAddr)"); ((sum+=${bytes}));
done; echo "TotalMB: " ; calc "$sum/(1024*1024)";<br>
<b>TotalMB: <br>
3745.726528167724609375</b><br>
<br>
<big>There is still missing almost 400MB. If i think correct, in
/proc/iomem should be map of all memory, so it should cover all
4096 MB, right ??<br>
<br>
Lets, count amount of ram not available for user, reserved for
(mapped IO) ACPI, PCI bus etc:<br>
<br>
</big>for i in `cat /proc/iomem | grep -v "System RAM" | grep -P
"^[^\s]" | awk '{ print $1}' | sort | uniq`; do startAddr=$(echo
$i | awk -F "-" '{print $1}') && endAddr=$(echo $i | awk
-F "-" '{print $2}'); bytes=$(calc "(0x$endAddr-0x$startAddr)");
((sum+=${bytes})); done; echo "TotalMB: " ; calc
"$sum/(1024*1024)";<br>
<b>TotalMB: <br>
683.65817165374755859375</b><br>
<big><br>
Only 683MB, so if my calculation are correct, where disappear
400MB?? It seems to be that OS doesn't even sees this 400MB. Any
idea?<br>
<br>
<br>
Extra logs:<br>
<br>
CPU is able to handle 36bit address size:<br>
<br>
<small>cat /proc/cpuinfo | grep address<br>
address sizes : 36 bits physical, 48 bits virtual<br>
address sizes : 36 bits physical, 48 bits virtual</small><br>
<br>
<br>
Enabled PAE in kernel - but in this case there should not be
difference (RAM isn't above 4GB)<br>
<br>
<small>cat /boot/config-2.6.33.1 | grep PAE<br>
CONFIG_X86_PAE=y</small><br>
<br>
<br>
My iomem:<br>
<br>
<small>root@lpt:~# cat /proc/iomem <br>
00000000-00001fff : System RAM<br>
00002000-0000ffff : reserved<br>
00010000-0009f7ff : System RAM<br>
0009f800-0009ffff : reserved<br>
000a0000-000bffff : Video RAM area<br>
000c0000-000c7fff : Video ROM<br>
000cf000-000d07ff : Adapter ROM<br>
000e0000-000fffff : reserved<br>
000f0000-000fffff : System ROM<br>
00100000-bf67ffff : System RAM<br>
00100000-005951c8 : Kernel code<br>
005951c9-007be6e7 : Kernel data<br>
00854000-008dfadb : Kernel bss<br>
bf680000-bf6fffff : ACPI Non-volatile Storage<br>
bf700000-bfffffff : reserved<br>
c0000000-c3ffffff : PCI Bus 0000:06<br>
c0000000-c3ffffff : PCI CardBus 0000:07<br>
c4000000-c41fffff : PCI Bus 0000:02<br>
c4200000-c43fffff : PCI Bus 0000:02<br>
c4400000-c45fffff : PCI Bus 0000:03<br>
c4600000-c47fffff : PCI Bus 0000:03<br>
c4800000-c49fffff : PCI Bus 0000:04<br>
c4a00000-c4bfffff : PCI Bus 0000:04<br>
c4c00000-c4dfffff : PCI Bus 0000:05<br>
c4e00000-c4e00fff : Intel Flush Page<br>
c8000000-cbffffff : PCI CardBus 0000:07<br>
d0000000-dfffffff : 0000:00:02.0<br>
e0000000-efffffff : PCI MMCONFIG 0000 [bus 00-ff]<br>
e0000000-efffffff : reserved<br>
e0000000-efffffff : pnp 00:01<br>
f0000000-f007ffff : 0000:00:02.0<br>
f0080000-f00fffff : 0000:00:02.1<br>
f0100000-f01fffff : PCI Bus 0000:05<br>
f0100000-f0100fff : 0000:05:00.0<br>
f0100000-f0100fff : iwl3945<br>
f0200000-f02fffff : PCI Bus 0000:06<br>
f0200000-f0201fff : 0000:06:01.0<br>
f0200000-f0201fff : 0000:06:01.0<br>
f0202000-f0202fff : 0000:06:04.0<br>
f0202000-f0202fff : yenta_socket<br>
f0203000-f020307f : 0000:06:04.1<br>
f0203100-f02031ff : 0000:06:04.4<br>
f0203100-f02031ff : mmc1<br>
f0203400-f02034ff : 0000:06:04.2<br>
f0203400-f02034ff : mmc0<br>
f0203800-f020387f : 0000:06:04.3<br>
f0300000-f033ffff : 0000:00:02.0<br>
f0340000-f0343fff : 0000:00:1b.0<br>
f0340000-f0343fff : ICH HD audio<br>
f0544000-f05443ff : 0000:00:1d.7<br>
f0544000-f05443ff : ehci_hcd<br>
fec00000-fec0ffff : reserved<br>
fec00000-fec003ff : IOAPIC 0<br>
fed00000-fed003ff : HPET 0<br>
fed00000-fed003ff : reserved<br>
fed00000-fed003ff : pnp 00:04<br>
fed14000-fed19fff : reserved<br>
fed14000-fed17fff : pnp 00:01<br>
fed18000-fed18fff : pnp 00:01<br>
fed19000-fed19fff : pnp 00:01<br>
fed1c000-fed8ffff : reserved<br>
fed1c000-fed1ffff : pnp 00:01<br>
fed20000-fed3ffff : pnp 00:01<br>
fee00000-fee00fff : Local APIC<br>
fee00000-fee00fff : reserved<br>
ff000000-ffffffff : reserved<br>
</small><br>
<br>
</big></small>
<pre wrap="">--
regards
Andrzej Kardas
<a class="moz-txt-link-freetext" href="http://www.linux.mynotes.pl">http://www.linux.mynotes.pl</a>
</pre>
<br>
<small><big><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</big></small><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>