* (kernel 2.6.9) insmod: -1 Invalid module format
@ 2004-12-03 5:17 Stephane Coulombe Bisson
2004-12-03 5:13 ` Randy.Dunlap
2004-12-03 12:59 ` Josh Boyer
0 siblings, 2 replies; 6+ messages in thread
From: Stephane Coulombe Bisson @ 2004-12-03 5:17 UTC (permalink / raw)
To: linux-kernel
Hi,
I'm new to Linux module dev, I copied a very simple module from a book
(http://lwn.net/Kernel/LDD2/ch02.lwn) and I can't insert it into the
kernel.
I found hundreds of bug reports about it on google without any solution.
I must be doing something wrong...
/*----------mymodule.c-----------*/
#define MODULE
#include <linux/module.h>
int init_module(void)
{ printk("<1>Hello, world\n"); return 0; }
void cleanup_module(void)
{ printk("<1>Goodbye cruel world\n"); }
/*----------EOF-----------*/
# gcc -c mymodule.c
# insmod mymodule.o
insmod: error inserting 'mymodule.o': -1 Invalid module format
Thanks a lot
steph
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: (kernel 2.6.9) insmod: -1 Invalid module format
2004-12-03 5:17 (kernel 2.6.9) insmod: -1 Invalid module format Stephane Coulombe Bisson
@ 2004-12-03 5:13 ` Randy.Dunlap
2004-12-03 5:31 ` Stephane Coulombe Bisson
2004-12-03 12:59 ` Josh Boyer
1 sibling, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2004-12-03 5:13 UTC (permalink / raw)
To: Stephane Coulombe Bisson; +Cc: linux-kernel
Stephane Coulombe Bisson wrote:
> Hi,
>
> I'm new to Linux module dev, I copied a very simple module from a book
> (http://lwn.net/Kernel/LDD2/ch02.lwn) and I can't insert it into the
> kernel.
>
> I found hundreds of bug reports about it on google without any solution.
> I must be doing something wrong...
>
> /*----------mymodule.c-----------*/
> #define MODULE
> #include <linux/module.h>
> int init_module(void)
> { printk("<1>Hello, world\n"); return 0; }
> void cleanup_module(void)
> { printk("<1>Goodbye cruel world\n"); }
> /*----------EOF-----------*/
>
> # gcc -c mymodule.c
> # insmod mymodule.o
> insmod: error inserting 'mymodule.o': -1 Invalid module format
a. You need to use more than 'gcc -c module.c' to build a module
for Linux 2.6.x. See current linux/Documentation/kbuild/*.txt .
b. You load a module file named "mymodule.ko" for Linux 2.6.x,
not "mymodule.o".
c. Make sure that you are using current module-init-tools package.
--
~Randy
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: (kernel 2.6.9) insmod: -1 Invalid module format
2004-12-03 5:17 (kernel 2.6.9) insmod: -1 Invalid module format Stephane Coulombe Bisson
2004-12-03 5:13 ` Randy.Dunlap
@ 2004-12-03 12:59 ` Josh Boyer
1 sibling, 0 replies; 6+ messages in thread
From: Josh Boyer @ 2004-12-03 12:59 UTC (permalink / raw)
To: Stephane Coulombe Bisson; +Cc: linux-kernel
On Thu, 2004-12-02 at 23:17, Stephane Coulombe Bisson wrote:
> Hi,
>
> I'm new to Linux module dev, I copied a very simple module from a book
> (http://lwn.net/Kernel/LDD2/ch02.lwn) and I can't insert it into the
Just an FYI, but that book relates to the 2.4 version of the kernel.
The next version deals with 2.6, and I think the author hinted it would
be available around February.
josh
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-12-03 12:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-03 5:17 (kernel 2.6.9) insmod: -1 Invalid module format Stephane Coulombe Bisson
2004-12-03 5:13 ` Randy.Dunlap
2004-12-03 5:31 ` Stephane Coulombe Bisson
2004-12-03 5:23 ` Randy.Dunlap
2004-12-03 5:27 ` Randy.Dunlap
2004-12-03 12:59 ` Josh Boyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox