Skip to contentSkip to conversation

"couldn't find the kernel version the module was compiled for" - help!

DISCUSSION Keith Owens 3 participants 3 messages Nov 15, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines · Timur Tabi

Ok, I made this change:

#ifndef __ENTRY_C__
#define __NO_VERSION__
#endif
#include <linux/version.h>

Quoted 6 lines

and in entry.c:

#define __ENTRY_C__
#include "include.h"

Unfortunately, it still doesn't work.

__NO_VERSION__ must be defined before #include <module.h>. Do it by hand.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw

** Reply to message from Keith Owens <[email protected]> on Wed, 15 Nov 2000 10:41:42 +1100

Quoted 1 line

__NO_VERSION__ must be defined before #include <module.h>.

It is:

#ifdef LINUX
#ifndef __ENTRY_C__
#define __NO_VERSION__
#endif
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>

Quoted 1 line

Do it by hand.

I don't know what you mean by that.

Signature · 8 lines
Timur Tabi - [email protected]
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please direct the reply to the mailing list only.  Don't send another copy to me.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#2 lore raw
In reply to Keith Owens
Quoted 17 lines · Timur Tabi

** Reply to message from Keith Owens <[email protected]> on Wed, 15 Nov 2000 10:41:42 +1100

Quoted 1 line

__NO_VERSION__ must be defined before #include <module.h>.

It is:

#ifdef LINUX
#ifndef __ENTRY_C__
#define __NO_VERSION__
#endif
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>

Quoted 4 lines
Quoted 1 line

Do it by hand.

I don't know what you mean by that.

Module source should look like this:

single .c -> single .o

    #include <linux/kernel.h>
    #include <linux/module.h>

multiple .c -> single .o, main .c file (contains init_module(), etc.)

    #include <linux/kernel.h>
    #include <linux/module.h>

multiple .c -> single .o, secondary .c file

    #include <linux/kernel.h>

multiple .c -> single .o, secondary .c file that requires module.h for a particular purpose, such as EXPORT_SYMBOL()

    #define __NO_VERSION__
    #include <linux/kernel.h>
    #include <linux/module.h>

Note that in most cases, you _don't_ need to include module.h.

Your Makefile should call gcc with '-D__KERNEL__ -DMODULE', as well as other approprate flags.

dave...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/