当前位置: 技术问答>linux和unix
在运行命令:insmod ./hello.ko后出现如下错误信息!!!!
来源: 互联网 发布时间:2016-01-04
本文导语: 我现在已经编译好内核了,而且用《Linux设备驱动程序》书上的例子的makefile用make命令后生成了hello.o、hello.ko、hello.mok.o。现在又有新的问题了,在运行命令:insmod ./hello.ko后出现如下错误信息: insmod: error inserting '...
我现在已经编译好内核了,而且用《Linux设备驱动程序》书上的例子的makefile用make命令后生成了hello.o、hello.ko、hello.mok.o。现在又有新的问题了,在运行命令:insmod ./hello.ko后出现如下错误信息:
insmod: error inserting './hello.ko': -1 Invalid module format
其他几个文件也出现同样的错误提示
到 /var/log/下查看messages文件,看到的错误信息是:
Jul 3 15:06:29 localhost kernel: hello: disagrees about version of symbol struct_module
请问,这个问题该怎么解决?
insmod: error inserting './hello.ko': -1 Invalid module format
其他几个文件也出现同样的错误提示
到 /var/log/下查看messages文件,看到的错误信息是:
Jul 3 15:06:29 localhost kernel: hello: disagrees about version of symbol struct_module
请问,这个问题该怎么解决?
|
How did you build the module?
For 2.6 kernel, you have to compile modules differently. Have you followed the proper procedure? Also in 2.6, modules compiled for one version of the kernel cannot be inserted in another version (unlike 2.4).
If the module was properly built conforming to above issues, you can either insert abc.o or abc.ko (doesn't make any difference).
2.4 与 2.6 内核下,源码头文件 linux/version.h 定义有:
LINUX_VERSION_CODE ― 内核版本的二进制表示,主、从、修订版本号各对应一个字节;
KERNEL_VERSION(major, minor, release) - 由主、从、修订版本号构造二进制版本号。
For 2.6 kernel, you have to compile modules differently. Have you followed the proper procedure? Also in 2.6, modules compiled for one version of the kernel cannot be inserted in another version (unlike 2.4).
If the module was properly built conforming to above issues, you can either insert abc.o or abc.ko (doesn't make any difference).
2.4 与 2.6 内核下,源码头文件 linux/version.h 定义有:
LINUX_VERSION_CODE ― 内核版本的二进制表示,主、从、修订版本号各对应一个字节;
KERNEL_VERSION(major, minor, release) - 由主、从、修订版本号构造二进制版本号。
|
uname -r 看看你当前运行内核的版本
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。