memory: Adding memory size detection
authorErwan Velu <erwan.velu@free.fr>
Mon, 23 Nov 2009 12:39:55 +0000 (13:39 +0100)
committerErwan Velu <erwan.velu@free.fr>
Mon, 23 Nov 2009 12:39:55 +0000 (13:39 +0100)
commitd7ddef0afcc7224a002a4e9cb3e54a3c216d0f6f
treec474d25fe1d15d909a218795c5b379d532267f06
parentae69dd05fc133f67664816db4564a5202d6b2301
memory: Adding memory size detection

Impact: allow com32 module to detect the amount of memory installed

This commit adds several function:

sanitize_e820_map() to generate a new e820 map that doesn't have
overlaping

memsize_e820() to detect the available memory (in KB)

detect_memsize() to detect the amount of memory by using e820/e801/e88.
It first try to detect the memory via e820. If it fails, it uses e801 as
fallback. If this e801 fails, e88 is used.
com32/gplinclude/memory.h
com32/gpllib/memory.c