From: "Tyler BIRD" <BIRDTY@uvsc.edu>
To: <nmundi@karthika.com>, <linux-kernel@vger.kernel.org>
Cc: <apiggyjj@yahoo.ca>
Subject: Re: Insmod problems
Date: Tue, 04 Dec 2001 09:42:38 -0700 [thread overview]
Message-ID: <sc0c9a91.035@mail-smtp.uvsc.edu> (raw)
You need to define the __KERNEL__ and MODULE symbols
#define __KERNEL__
#define MODULE
>>> Nav Mundi <nmundi@karthika.com> 12/04/01 09:33AM >>>
What are we doing wrong? - Nav & Michael
**************************************************
hello.c Source:
#include "/home/mzhu/linux/include/linux/config.h"
/*retrieve the CONFIG_* macros */
#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
#define MODVERSIONS /* force it on */
#endif
#ifdef MODVERSIONS
#include "/home/mzhu/linux/include/linux/modversions.h"
#endif
#include "/home/mzhu/linux/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"); }
Output:
#>gcc -D_KERNEL_ -DMODULE -c hello.c
[This builds the hello.o file. ]
#>insmod hello.o
hello.o : unresolved symbol printk
hello.o : Note: modules without a GPL compatible license cannot use
GPONLY_symbols
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2001-12-04 16:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-04 16:42 Tyler BIRD [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-12-04 18:24 Insmod problems Tyler BIRD
[not found] <sc0ca5e8.017@mail-smtp.uvsc.edu>
2001-12-04 18:20 ` Michael Zhu
2001-12-04 18:33 ` Tommy Reynolds
2001-12-04 19:10 ` Alan Cox
[not found] <81C25B579A82D31192BE00105A812084028931E9@AUGUSTA>
2001-12-04 18:13 ` Michael Zhu
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: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=sc0c9a91.035@mail-smtp.uvsc.edu \
--to=birdty@uvsc.edu \
--cc=apiggyjj@yahoo.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=nmundi@karthika.com \
/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