Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
linux/memblock.h头文件中有memblock_phys_mem_size函数,但它没有从内核导出,因此不能在模块中使用。
是否有另一种方法来识别 RAM 大小?
使用以下符号:
$ grep EXPORT_SYMBOL mm/*.c | grep total mm/highmem.c:EXPORT_SYMBOL(totalhigh_pages); mm/page_alloc.c:EXPORT_SYMBOL(totalram_pages);