Question on kernel-Module version mismatch
Hi All,
I'm newer here who now is learning linux driver development. As I tried to insmod my first module "Hello.c" in Linux, system indicated like this: hello.o: Kernel-Module Version mismatch hello.c was compiled for kernelversion 2.4.20 while this kernel version is 2.4.20-8. My question is: 1. why version mismatch happened? 2. How to solve this problem? Thanks for your best helps, looking forward to your replies :) Yours truely, bin |
When you compiled your module, you would have used the kernel header files.
1) You need to make sure that the version of the header files you are using match the kernel version you are running. Otherwise the module may not work (and insmod is protecting you because of the mismatched versions). Perhaps you have multiple versions of the header files, or have compiled a custom kernel with a different subversion. 2) If you are certain that the header files are correct (matching), you can force the module to be inserted (using 'modprobe -f module'). But you do not normally need to do this. |
1 Attachment(s)
Quote:
But,as attched, there is a warning related to the license.Again, I have no idea how to deal with it, need more helps. |
That is merely a warning that your module has not defined its licensing.
This is not a problem (because it doesn't affect the functionality), but it is a way of making sure that restricted license modules don't get accidentally distributed with free software. You need to define a MODULE_LICENSE string, eg Code:
MODULE_LICENSE("GPL"); If you look in the header files at include/linux/module.h, there is a list of compatible licenses. |
All times are GMT -5. The time now is 01:46 PM. |