- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试编译并插入 r8169 realtek 以太网驱动程序。我的内核版本是
ebin@sony:~$ uname -r
4.2.0-rc3-custom
我的本地磁盘中有相同的完整源代码,用于安装当前内核。当我运行 make -C/lib/modules/
uname -r/build M=
pwdmodules
时模块编译成功但是当我插入模块时,它显示
ebin@sony:~/linux_testing/linux-stable/drivers/net/ethernet/realtek$ sudo insmod r8169.ko
insmod: ERROR: could not insert module r8169.ko: Unknown symbol in module
ebin@sony:~/linux_testing/linux-stable/drivers/net/ethernet/realtek$ dmesg
[16717.311216] r8169: Unknown symbol mii_ethtool_gset (err 0)
当我搜索源代码时,我发现了
EXPORT_SYMBOL(mii_ethtool_gset);
已经在mii.c
中导出。所以我猜这不是未导出符号的问题。让我知道是否需要提供任何其他信息。请帮忙。
最佳答案
正如 Vadim Stupakov 在评论中所说,将 Module.symvers
文件放在模块源目录中解决了我的问题。从这个documentation
Module versioning is enabled by the CONFIG_MODVERSIONS tag, and is used
as a simple ABI consistency check. A CRC value of the full prototype
for an exported symbol is created. When a module is loaded/used, the
CRC values contained in the kernel are compared with similar values in
the module. if they are not equal, the kernel refuses to load the
module.
Module.symvers contains a list of all exported symbols from a kernel
build.
据我了解,Module.symvers
是在make modules
上创建的。我错过了那个文件。当我将适当的 Module.symvers
放入模块构建目录时,该模块按我预期的方式工作,没有任何错误。
关于linux - "Unknown symbol in module"在模块插入时尽管有 EXPORT_SYMBOL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32392611/
众所周知,在使用 EXPORT_SYMBOL("function name") 时,我们进入 System.map 中的符号列表,将函数名称作为符号。 c041bc90 b packet_sklist
假设我在文件 new.c 中定义了一个函数 hello_world()。我用这个文件 new.c 和另一个文件 hello.c 创建了一个模块。这个模块将被称为 new.ko。使用 EXPORT_SY
我是 linux 内核的新手。我搜索了一些 EXPORT_SYMBOL 但我还是有点困惑。我知道它用于将一个模块中定义的变量或函数导出到另一个模块。这是否意味着通过使用它,我们不需要包含任何声明该变量
我想在我的 netfilter 模块中使用 net/ip_options.c 文件中定义的函数,如 ip_options_compile、ip_options_build。 我想将选项放入 IP 数据
我正在制作一个简单的内核对象。但不知何故,变量没有用 EXPORT_SYMBIL 宏导出。来源是: #include #include MODULE_LICENSE("Dual BSD/GPL")
我有一个内核模块,其结构如下: struct test { int a; int b; ..... } 我已经创建了这个结构的一个实例数组: struct test foo[8
来自 here 48 struct snd_card *snd_cards[SNDRV_CARDS]; 49 EXPORT_SYMBOL(snd_cards); 我不明白它的含义以及使用它的原因。
我正在尝试编译并插入 r8169 realtek 以太网驱动程序。我的内核版本是 ebin@sony:~$ uname -r 4.2.0-rc3-custom 我的本地磁盘中有相同的完整源代码,用
我们需要访问 net/ipv4/af_inet.c 中的内核全局变量,这些变量未从可加载内核模块中显式导出。我们目前使用的是2.6.18内核。 kallsyms_lookup_name 似乎不再可用(
我正在 aarch64 机器上开发 4.9 Linux 内核,特别是 mm/memory.c 和自定义平台设备驱动程序。我的目标是让我的设备驱动程序将一些信息传递给源自 memory.c 中函数的硬件
我有一个来自 a.ko(内核模块)的导出函数 foo() 和 foo1(),foo1() 接受输入参数,一个函数指针。我从 b.ko 调用 foo1(),并将 foo() 作为输入参数传递。 我看到
我有一个头文件,其中声明了几个全局变量,格式如下: constants.h #ifndef CONSTANTS_H #define CONSTANTS_H extern unsigned var; E
当我遇到这个错误时,我正在将一些驱动程序嵌入到 Linux 内核中(我正在将设备添加到板文件中并注册它): error: 'kxtf9_get_slave_descr' undeclared here
我是一名优秀的程序员,十分优秀!