How can the physical RAM size be determined from kernel module?

Go To StackoverFlow.com

1

There is function memblock_phys_mem_size at linux/memblock.h header, but it doesn't exported from kernel so it can't be used in module.

Is there another way to identify RAM size?

2012-04-04 08:16
by Anton Vasilyev
This function marked as __init in addition so event if you try to use it you can't - Ilya Matveychikov 2012-04-04 12:49


0

Use the following symbols:

 $ grep EXPORT_SYMBOL mm/*.c | grep total
 mm/highmem.c:EXPORT_SYMBOL(totalhigh_pages);
 mm/page_alloc.c:EXPORT_SYMBOL(totalram_pages);
2012-04-04 12:52
by Ilya Matveychikov
Thanks you for answer. It helps me to find symbol 'num_physpages' which satisfy requiremen - Anton Vasilyev 2012-04-04 13:41
Ads