public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: Stephane Coulombe Bisson <stephcoul@aei.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: (kernel 2.6.9) insmod: -1 Invalid module format
Date: Thu, 02 Dec 2004 21:13:27 -0800	[thread overview]
Message-ID: <41AFF5F7.1040304@osdl.org> (raw)
In-Reply-To: <1102051062.5992.8.camel@localhost.localdomain>

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

  reply	other threads:[~2004-12-03  5:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-03  5:17 (kernel 2.6.9) insmod: -1 Invalid module format Stephane Coulombe Bisson
2004-12-03  5:13 ` Randy.Dunlap [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41AFF5F7.1040304@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephcoul@aei.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox