wRAR писал(а):
Вы б ошибки-то показали.
Ошибки я получаю следедующие (это только маленькая часть, их ОЧЕНЬ много):
Код:
In file included from include/linux/slab.h:97,
from include/linux/percpu.h:4,
from include/linux/sched.h:34,
from include/linux/module.h:10,
from /root/mymod/mymod.c:2:
include/linux/kmalloc_sizes.h:1:6: warning: "PAGE_SIZE" is not defined
include/linux/kmalloc_sizes.h:5:5: warning: "L1_CACHE_BYTES" is not defined
include/linux/kmalloc_sizes.h:9:5: warning: "L1_CACHE_BYTES" is not defined
In file included from include/linux/percpu.h:4,
from include/linux/sched.h:34,
from include/linux/module.h:10,
from /root/mymod/mymod.c:2:
include/linux/elf.h:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Addr’
include/linux/elf.h:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Half’
include/linux/elf.h:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Off’
include/linux/elf.h:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Sword’
include/linux/elf.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Word’
include/linux/elf.h:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf64_A
и т.д. и в конце
Код:
make[1]: *** [/root/mymod/mymod.o] Error 1
make: *** [_module_/root/mymod] Error 2
make: Leaving directory `/root/kernel'
Что я уже только не делал. Пробывал компилити gcc -c mymod.c, ошибки те же. Делал функции статачными и не статичными, пользовалься макросом MODULE и фн. init_module & cleanup_module, добавлял __init & __exit. Ниче не помогает. Что я делаю не так? Помогите плз. очень надо.