Why can’t you stop buying 618?From the technical dimension to explore>>>
There is a problem when compiling a print HelloWorld information driver module
insmod: ERROR: could not insert module hello_ world.ko: Invalid module format
The problem should be that the Linux header file directory selected when compiling the module does not match the currently running system version. Use the command: uname – r to view the currently running kernel version, and then select the correct Linux header file path. You can also download the Linux source code corresponding to the machine kernel. In this way, you can specify the Linux header file directory to the specified source code directory
After querying the kernel version information, modify the path in the makefile file file to make compilation and then load the kernel module
In addition, the information printed by the module’s printk cannot be directly displayed on the terminal. You can use dmesg to view the information since the power on, and you can see the information output by the printk. You can use dmesg | tail to view the last few messages. Rmmod can be used to remove the installed modules
Or you can use the dmesg command to check the possible error information:
It can be seen that the module version information of the previous Ko file does not match the current kernel version information. You can recompile the KO file that needs to be loaded: make helloworld.mk to get the new Ko file. At this time, you will find that it has passed when you reload the module
Reference article:
http://stackoverflow.com/questions/21244481/error-using-insmod-could-not-insert-module-hello-world-ko-invalid-module-forma
Similar Posts:
- [Solved] NFS Failed to mount: Nothing Happened or “No such device” Error
- [Solved] JAVA Run Error: Error: Could not find or load main class
- [Solved] –go_out: protoc-gen-go: Plugin failed with status code 1.
- Centos7 vmware Install Error: C header files matching your running kernel were not found.
- [Solved] docker-compose:No module named ssl_match_hostname; ImportError: No module named shutil_get_te…
- linux:/lib/libc.so.6: version `glibc_2.7′ not foun
- [Solved] Linux Core Compile Error: No rule to make … ipt_ecn.c
- /lib64/libc.so.6: version `GLIBC_2.14′ not found [How to Solve]
- [Solved] Java compilation error: unmapped character encoding GBK
- [Solved] Ruby cannot load such file — zlib, openssl(LoadError), gem No rule to make target `/include/ruby.h’