Friday, March 4, 2011

Learning the Linux Boot Memory Allocator (MIPS)

Do you ever look at the report of 'cat /proc/meminfo' and wonder why the reported MemTotal is not equal to the amount of memory you have for the system? The followed is an example report from one of my systems. It shows the total memory is 60860kB (59.4MB) from line 2:

1 # cat /proc/meminfo
2 MemTotal:          60860 kB
3 MemFree:           47448 kB
4 Buffers:               0 kB
5 Cached:             7180 kB
6 SwapCached:            0 kB
7 ... 

which is different from the amount of memory that bootloader gave to kernel, 64MB.
1 ...
2 ## Transferring control to Linux (at address 800042f0) ...
3 ## Giving linux memsize in MB, 64