0

每个版本的linux都有一些基本的内核模块吗?比如每个版本的linux都加载parport模块吗?

我想在内存中搜索一些模块名称,并获取模块的位置。

4

2 回答 2

2

Is there some basic kernel modules in linux in every version?

No, there isn't some kernel module that is present in every version. It is still possible (and, for some environments, preferred) to disable kernel module support altogether.

I want to search some module name in the memory, and get the location of the module.

Check for the existence of /proc/modules. If it exists, parse it. Each module is listed there. The first field of each line is the name of a module. The sixth field is its address.

于 2012-10-31T17:49:33.113 回答
0

要获取正在运行的内核中的所有模块,您可以使用该lsmod命令。

要搜索特定模块,您可以将其 grep 为...

lsmod | grep "your_module_without_inverted_comma"

它将提供一些信息作为模块使用的大小。

用于获取模块的内存位置

cat /proc/modules | grep "your_module_without_inverted_comma" 
于 2012-11-05T05:46:21.023 回答