linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* First try with module: need help
@ 2000-04-24  9:48 root
  0 siblings, 0 replies; only message in thread
From: root @ 2000-04-24  9:48 UTC (permalink / raw)
  To: linuxppc-dev


I try the very simple module (below) in "Linux device driver" by
Alessandro Rubini
and I get this error message:

couldn't find the kernel version the module was compiled for

even if the first line of the C source is

#define __NO_VERSION__

Do I need something special to complile the module


----------------- mod_1.c


#define MODULE
#define __NO_VERSION__
#include <linux/module.h>
#include <linux/version.h>

int init_module(void)
{
 printk("<1>This is a simple module\n");
 return 0;
}

void cleanup_module(void)
{
 printk("<1>The simple module is done\n");
}


-----------------  to compile

if test -f ./mod
 then
 rm ./mod
fi

gcc  -c mod_1.c -o mod.o

if test -f ./mod.o
 then
 insmod -f mod.o
 echo 'blablabla'
 rmmod  mod
fi


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-04-24  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-24  9:48 First try with module: need help root

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).