[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Invalid module format.
Hi guys.
I have this module, taken from http://lwn.net/Articles/21817
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
I compile it with this Makefile, suggested too in LWN:
KERNELDIR = /usr/src/linux
CFLAGS = -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O
module_hello.o: module_hello.c
and when i do 'insmod module_hello.o' i get:
Error inserting 'module_hello.o': -1 Invalid module format
¿Where is the error?. I use module-init-tools 0.9.10.
Thanks, very much, in advance.
Regards.
Jose.
http://linuxespana.scripterz.org
Debian GNU/Linux 'Sid' Kernel 2.5.62 Ext3.
ESware Linux 365 Kernel 2.5.62 ReiserFS.
Registered Linux User #213309.
Memories..... You are talking about memories.
Rick Deckard. Blade Runner.
_____________________________________________________________
Get your own free tiggerfan.com email address!!
DisneySites!! - http://www.disneysites.com/webmail/tiggerfan
_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/