From: Eric Gaumer <gaumerel@ecs.fullerton.edu>
To: gene.heskett@verizon.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: makeing a loadable module
Date: Sun, 07 Nov 2004 22:08:55 -0800 [thread overview]
Message-ID: <1099894136.18456.5.camel@localhost> (raw)
In-Reply-To: <200411072328.48785.gene.heskett@verizon.net>
[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]
On Sun, 2004-11-07 at 23:28 -0500, Gene Heskett wrote:
> Greetings;
>
> I found some code I can play with/hack/etc, in the form of a loadable
> module and some testing driver programs, in 'dpci8255.tar.gz'.
>
> Unforch its for a slightly different card than the one I have, and
> once I've hacked the code to suit, I need to rebuild it.
>
> So whats the gcc command line to make just a bare, loadable module for
> say a 2.4.25 kernel? Obviously I'm missing something when it
> complains and quits, claiming there is no 'main' defined, which I
> don't think modules actually have one of those?
>
> What I'm trying to do (hey, no big dummy jokes please :)
>
> [root@coyote dist]# cc -o dpci8255.o dpci8255lib.c
> /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o(.text+0x18):
> In function `_start':
> : undefined reference to `main'
> collect2: ld returned 1 exit status
>
> The gcc manpage isn't that helpfull and I've now read thru it twice.
This should work for a single source file
]$ gcc -O2 -D__KERNEL__ -DMODULE -DHAVE_CONFIG_H -I/usr/src/linux/include -c dcpi8255.c
If your using SMP then you'll need to define that as well.
--
Eric Gaumer <gaumerel@ecs.fullerton.edu>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-11-08 6:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-08 4:28 makeing a loadable module Gene Heskett
2004-11-08 6:08 ` Eric Gaumer [this message]
2004-11-08 22:37 ` Sam Ravnborg
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=1099894136.18456.5.camel@localhost \
--to=gaumerel@ecs.fullerton.edu \
--cc=gene.heskett@verizon.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.