I have just created a sample helloworld driver and it was built and deployed successfully at location /rootfs/lib/modules/2.6.27.8/misc/hello-1.ko. Yet when i run insmod hello-1.ko i get the output "insmod: cannot insert 'hello-1.ko': invalid module format" Following is my source file and the makefile.
***************hello-1.c****************** #include <linux/module.h> /* Needed by all modules */ #include <linux/kernel.h> /* Needed for KERN_INFO */ int init_module(void) { printk(KERN_INFO "Hello world 1.\n");
return 0; }
void cleanup_module(void) { printk(KERN_INFO "Goodbye world 1.\n"); }
*****************Makefile********************** ifneq ($(KERNELRELEASE),) # kbuild part of makefile
obj-m += hello-1.o