To load a module, the kernel must contain all the kernel symbols used in the module. If those symbols were not included in the kernel at compile time, the module will not be loaded due to missing dependencies.
这个意思是内核模块应该用完整的内核编译来编译,以包含vmlinux中的内核模块符号,如果我们单独编译模块那么我们将无法在运行时加载内核?
请纠正我的理解,即使我提出错误的问题,请更正 .
1 回答
如果我'm not mistaken, you'重新引用这篇文章:http://www.linuxjournal.com/content/kbuild-linux-kernel-build-system?page=0,0
这个声明引用了内核编译,而不是模块编译(而是加载) .
这不完全正确 . 这是The Linux Kernel Module Programming Guide的例子
因此,即使符号未使用内核编译(但由不同模块提供),您仍然可以加载模块
但是,想象一下,如果没有
printk
支持你编译内核 . 现在,您尝试加载的每个模块都会尝试查找根本不存在的printk
函数 . 因此,您需要在编译内核时做出合理的决定,以包含可以加载所有可能加载的模块的基本要素 .