c - 无法 insmod 或使用内核间模块

标签 c kernel insmod

我在内核驱动程序 1 (KD1.ko) 中有一个函数:

static void test (void);
EXPORT_SYMBOL(test);

static void test() {
    printk("<<< MISSION DONE >>>.\n");
}

在内核驱动程序 2 (KD2.ko) 中:

extern static void test (void);

我试着这样调用它。

我设法 insmod KD1.ko,但我无法 insmod KD2.ko。 我错过了什么吗?

最佳答案

test()static

所以你不能导出静态函数。

http://osdir.com/ml/linux.kernel.kernelnewbies/2003-02/msg00149.html

关于c - 无法 insmod 或使用内核间模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21746378/

相关文章:

c - 在虚拟内存系统上强制执行介质类型

C:扫描 While not EOF 循环意外结果

c - printf 区分字符和数字

android - 未定义对 `cnss_get_platform_cap' 的引用

C指针转换规则

process - 如何判断进程是在内核空间还是用户空间?

linux - linux 内核如何强制执行堆栈大小限制?

linux - 无法在 debian 8 中 insmod hello_world 内核模块

linux-kernel - 内核模块中的驱动程序代码不执行?