Hi all
I am a newbie in kernel programming and of course faced such a trouble
I have 2 PCs with Slackware 10.0 and generic kernel
vmlinuz-ide-2.4.29 installed on both of them. The PC 1-st pc works fine, on the 2-nd pc i can't compile properly the simplest kernel module like this:
Code:
#define MODULE
#define __KERNEL__
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk("example.o: loaded\n");
return 0;
}
void cleanup_module(void)
{
printk("example.o: unloaded...\n");
}
=======================
Makefile:
CC=gcc
module=example
MODFLAGS:= -O3 -Wall -DLINUX
$(module).o: $(module).c
$(CC) $(MODFLAGS) -c $^ -o $@
The compilation works without warnings on both pc's, but when i try to load the module on my 2-nd pc i get such an error:
couldn't find the kernel version the module was compiled for
It looks as if i deleted first 2 define strings in the code(#define MODULE and #define __KERNEL__).
Other kernels on the 2-nd pc gives the same result