我从“ The Linux Kernel Module Programming Guide ”编译(没有警告)hello-5.c
示例,当我尝试对其进行安装时,我收到以下错误:
insmod: error inserting 'hello-5.ko': -1 Unknown symbol in module
我想我会尝试夹板看看它是否出现任何明显的错误,但是当我运行它时,我从内核头文件中收到了一系列警告,直到它试图解析asm/types.h
anon@anon:~/kernel-source/lkmpg$ splint -I/lib/modules/$(uname -r)/build/include hello-5.c
Splint 3.1.1 --- 03 Nov 2006
( ... lots of warnings ... )
/lib/modules/2.6.24-24-insp8600/build/include/asm/types.h:13:24: Parse Error:
Suspect missing struct or union keyword: __signed__ :
unsigned short int. (For help on parse errors, see splint -help
parseerrors.)
*** Cannot continue.
所以真的有两个问题:
- 如何修复 insmod 错误?
- 如何让夹板与内核头文件配合得很好?