I followed the steps in the forum (http://www.schaeuffelhut.de/wordpress/?p=237&cpage=1#comment-384) to get the linux kernel source and and cross compile my module. The kernel version of the google nexus one is exactly the same as in the forum. I initially tested with my test module hello-1.ko which got installed on the android device successfully. But when I am installing my module ec.ko on the android device using insmod, I get the following error.
apurva@apurva-Inspiron-1464:~/$ adb shell
$ cd sdcard/data/ec
$ ls
ec.ko
$ su
# insmod ec.ko
insmod: init_module 'ec.ko' failed (No such file or directory)
#
It is clear that the file ec.ko is present. But I am not sure why it is not picking the file. I did the same thing for hello-1.ko and it gets insmod pretty fine. There is no permission issue, and ec.ko gets the same permission as was obtained by hello-1.ko.
Now this bring me to the question, Are there certain limitations of a kernel module in an android device because this module gets insmod in Ubuntu. Next action for me is to go for a hit and trial method and check what lines in ec.c is causing the problem. Meanwhile if you some suggestion, please let me know.
Insmod copies the module into the allocated space and relocates it so that it will run from the kernel address that it has been allocated. This must happen as the module cannot expect to be loaded at the same address twice let alone into the same address in two different Linux systems.
insmod is similar to modprobe: it can insert a module into the Linux kernel. Unlike modprobe, however, insmod does not read its modules from a set location, automatically insert them, and manage any dependencies. insmod can insert a single module from any location, and does not consider dependencies when doing so.
The insmod Command ko) into the kernel. There are only 2 options - on -h for help, and -V fto show the version of insmod. This example shows running the insmod command from the /lib/modules/$(uname -r) directory, and that the . ko file exists in the specified directory.
You can check the dmesg log to see something can help you.I have also encountered the same problem.Following is how I solved this problem. I installed my module on the android device by using insmod command,but I got the same error message like you.I checked the dmesg at that time,and I got this:Unknown symbol "XXX"(I have forgotten the function name.).I used the command —— cat /proc/kallsyms |grep "XXX" to find this symbol,but I found nothing.The reason for this problem is the function have been deprecated in AndroidM.Finally,I fixed this problem by annotating the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With