On Mon, Aug 16, 2010 at 12:26 PM, malay jajodia
<address@hidden> wrote:
Hi,
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
else # Normal part of the Makefile
KERNELDIR = ../linux
ARCH = $(LINTARCH)
all:
$(MAKE) ARCH=$(ARCH) -C $(KERNELDIR) M=$(PWD)
install:
@echo "copy hello-1.ko to your module directory"
clean:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
@rm -f Module.symvers
endif
----------------------------
Please help!
-Malay
_______________________________________________
LTIB home page: http://ltib.org
Ltib mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/ltib