From: Tommy Reynolds <reynolds@redhat.com>
To: apiggyjj@yahoo.ca
Cc: linux-kernel@vger.kernel.org
Subject: Re: Insmod problems
Date: Tue, 4 Dec 2001 12:33:27 -0600 [thread overview]
Message-ID: <20011204123327.7e7618b7.reynolds@redhat.com> (raw)
In-Reply-To: <20011204182023.87068.qmail@web20206.mail.yahoo.com>
In-Reply-To: <sc0ca5e8.017@mail-smtp.uvsc.edu> <20011204182023.87068.qmail@web20206.mail.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]
More important activities lacking, "Michael Zhu" <apiggyjj@yahoo.ca> wrote:
> I've changed my source file like this:
> #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"); }
>
> And I use the following command line to build the
> module.
>
> gcc -c -D__KERNEL__ hello.c
>
> But when I use insmod to load the module I got the
> following error message:
>
> hello.o : kernel-module version mismatch
> hello.o was compiled for kernel version
> 2.4.12
> while this kernel is version 2.4.8
>
> What is wrong? My kernel version is 2.4.8. Is there
> something wrong with the gcc compilier? My gcc
> compilier is gcc-2.95.
You're not picking up the correct kernel header files. Don't allow GCC to pick
up the files from "/usr/include/linux":
$ gcc -I/usr/src/linux/include -c -D__KERNEL__ hello.c
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- --
Tommy Reynolds | mailto: <reynolds@redhat.com>
Red Hat, Inc., Embedded Development Services | Phone: +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX: +1.256.837.3839
Senior Software Developer | Mobile: +1.919.641.2923
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2001-12-04 18:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <sc0ca5e8.017@mail-smtp.uvsc.edu>
2001-12-04 18:20 ` Michael Zhu
2001-12-04 19:10 ` Alan Cox
2001-12-04 18:33 ` Tommy Reynolds [this message]
2001-12-04 18:24 Tyler BIRD
[not found] <81C25B579A82D31192BE00105A812084028931E9@AUGUSTA>
2001-12-04 18:13 ` Michael Zhu
-- strict thread matches above, loose matches on Subject: below --
2001-12-04 17:30 Tyler BIRD
[not found] <sc0c9a91.036@mail-smtp.uvsc.edu>
2001-12-04 17:06 ` Michael Zhu
2001-12-04 16:55 ` Thiago Rondon
2001-12-04 17:47 ` rddunlap
2001-12-04 16:42 Tyler BIRD
2001-12-04 16:33 Nav Mundi
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=20011204123327.7e7618b7.reynolds@redhat.com \
--to=reynolds@redhat.com \
--cc=apiggyjj@yahoo.ca \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome