Модуль ядра
В чем может быть дело?
#insmod ./test.o
./test.o kernel module version mismach
./test.o was compiled for kernel version 2.4.9-9
while this kernel is version 2.4.18-14
Система Red Hat 8
//test.c
#include <linux/kernel.h>
#include <linux/module.h>
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif
char kernel_version[]="2.4.18-14"
int init_module()
{
printk("Hello, world - this is the kernel speaking\n");
return 0;
}
void cleanup_module()
{
printk("Short is the life of a kernel module\n");
}
#Makefile
CC=gcc
MODCFLAGS := -Wall -DMODULE -D__KERNEL__ -DLINUX
test.o: test.c /usr/include/linux/version.h
$(CC) $(MODCFLAGS) -c test.c