- 论坛徽章:
- 0
|
我在刚编译好的新内核下运行最简单的hello world!都报错一大堆,我用的是2.6.28的内核版本,已经把asm,linux等头文件copy到/usr/include下来,怎么还不行亚,我在原来的 25内核版本下,运行
make headers_install 仍然没有modules.h的头文件,没办法只好新编译内核了,可是还是报错一大堆。
gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -c hello.c
In file included from /usr/include/linux/prefetch.h:14,
from /usr/include/linux/list.h:6,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/asm/processor.h:113: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/usr/include/asm/processor.h:113: error: requested alignment is not a constant
/usr/include/asm/processor.h: In function ‘load_cr3’:
/usr/include/asm/processor.h:186: error: ‘CONFIG_PAGE_OFFSETUL’ undeclared (first use in this function)
/usr/include/asm/processor.h:186: error: (Each undeclared identifier is reported only once
/usr/include/asm/processor.h:186: error: for each function it appears in.)
/usr/include/asm/processor.h: At top level:
/usr/include/asm/processor.h:235: error: requested alignment is not a constant
/usr/include/asm/processor.h:272: error: requested alignment is not a constant
In file included from /usr/include/linux/elf.h:7,
from /usr/include/linux/module.h:14,
from hello.c:2:
/usr/include/asm/elf.h: In function ‘elf_common_init’:
/usr/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r8’
/usr/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r9’
/usr/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r10’
/usr/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r11’
/usr/include/asm/elf.h:168: error: ‘struct pt_regs’ has no member named ‘r12’
/usr/include/asm/elf.h:168: error: ‘struct pt_regs’ has no member named ‘r13’
/usr/include/asm/elf.h:168: error: ‘struct pt_regs’ has no member named ‘r14’
/usr/include/asm/elf.h:168: error: ‘struct pt_regs’ has no member named ‘r15’
In file included from /usr/include/linux/module.h:22,
from hello.c:2:
/usr/include/asm/module.h:68:2: error: #error unknown processor family
hello.c: In function ‘init_module’:
hello.c:10: warning: implicit declaration of function ‘prink’
make: *** [hello.o] Error 1
这是怎么回事亚! |
|