View Full Version: cannot insert module in Fedora Core 5

C++ Learning Community > C++ for Linux > cannot insert module in Fedora Core 5


Title: cannot insert module in Fedora Core 5


mailsubhra - December 12, 2006 12:20 PM (GMT)
Hi,
I have a small problem regarding inserting the module in Fedora Core 5 system.

first.c
CODE
#include <linux/module.h>
#include <linux/init.h>
MODULE_LICENSE("GPL");
int my_module (void) /* Loads a module in the kernel */
{
printk("Hello kernel n");
return 0;
}

void my_cleanup_module(void) /* Removes module from kernel */
{
printk("GoodBye Kerneln");
}
module_init(my_module);
module_exit(my_cleanup_module);


Makefile
CODE
LINUXINCLUDE += include/

#        nvdmp10_rtc-objs := nvdmp10_rtc_linux.o nvdmp10_rtc_core.o (Not needed for ur module)

ifneq ($(KERNELRELEASE),)
     obj-m := first.o
else
     KERNELDIR ?= /lib/modules/$(shell uname -r)/build
     PWD := $(shell pwd)
default:

       $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif


Now when I try this program in Fedora Core 3 system, it works fine.
But when I try to do the same in Fedora Core 5, the very command insmod fails.
QUOTE
[root@Nyquist wipro]# ls
bind-9.3.2      first.c  first.mod.c  first.o
bind-9.3.2.tar  first.ko  first.mod.o  Makefile
[root@Nyquist wipro]# insmod first.ko
insmod: error inserting 'first.ko': -1 Invalid module format
[root@Nyquist wipro]#


Please tell me as what could be the possible problem.


Thanks,
mailsubhra.




Hosted for free by InvisionFree