The default kernel does not support loading and uninstalling lkm. Therefore, you need to configure the kernel before compiling the android Linux kernel,
In the android Linux kernelSource code, Directory, run
$ Make menuconfig
The following figure is displayed:
In addition, select by left-click to uninstall the module.
Note:
If you use the official simulator kernel or do not configure the above:
1. When you run insmod hello. Ko to load the module, a message is displayed.
Insmod: init_module 'hello. Ko 'failed (function not implemented)
2. If you run rmmod hello. Ko to uninstall the module, the system will prompt
rmmod: delete_module 'Hello. ko "failed (errno 38)
after compiling the andorid kernel, recompile our hello module and start the simulator with our own compiled kernel:
$ emulator-AVD avd15-kernel ~ /Android_source/kernel/common/ARCH/ARM/boot/zimage-show-kernel
// Where
~ /Android_source/kernel/common/ARCH/ARM/boot/zimage is the compiled kernel image
// while show-kernel is used to display the system log information
operation as follows:
1) load and uninstall lkm
2) kernel log information
reference:
1. http://tjworld.net/wiki/Android/Linux/ARMCrossCompileOnIntel#BuildaCustomModule
2 develop lkm program in Android emulator
3 http://comments.gmane.org/gmane.comp.handhelds.android.kernel/810
attachment, the test program in this paper