日期:2014-05-16  浏览次数:20686 次

重新编译内核后,之前编译好的模块出错??
我之前的内核是2.4.20-8,   在该系统下,写了几个驱动程序模块,并且

运行良好;

后来,重新编译内核,使用原系统提供的源代码树,在其下面配置编译内核,

然后进入新内核的系统,发现之前写的模块make报错,然后回到原来的内核的系统,

make   仍然出错,不知道具体是什么原因;

错误代码如下:
-D__KERNEL__   -DMODULE   -I/usr/src/linux-2.4.20-8/include   -O   -Wall   -g   -c   short.c   -o   short.o
In   file   included   from   /usr/src/linux-2.4.20-8/include/linux/config.h:4,
                                  from   short.c:26:
/usr/include/linux/autoconf.h:1:2:   #error   Invalid   kernel   header   included   in   userspace
In   file   included   from   /usr/src/linux-2.4.20-8/include/linux/module.h:25,
                                  from   short.c:27:
/usr/include/asm/atomic.h:40:2:   warning:   #warning   Using   kernel   header   in   userland   program.   BAD!
In   file   included   from   /usr/src/linux-2.4.20-8/include/linux/dcache.h:7,
                                  from   /usr/src/linux-2.4.20-8/include/linux/fs.h:19,
                                  from   /usr/src/linux-2.4.20-8/include/linux/capability.h:17,
                                  from   /usr/src/linux-2.4.20-8/include/linux/binfmts.h:4,
                                  from   /usr/src/linux-2.4.20-8/include/linux/sched.h:10,
                                  from   short.c:29:
/usr/src/linux-2.4.20-8/include/linux/mount.h:   In   function   `mntget ':
/usr/src/linux-2.4.20-8/include/linux/mount.h:37:   warning:   implicit   declaration
of   function   `atomic_inc '
/usr/src/linux-2.4.20-8/include/linux/mount.h:   In   function   `mntput ':
/usr/src/linux-2.4.20-8/include/linux/mount.h:46:   warning:   implicit   declaration
of   function   `atomic_dec_and_test '
In   file   included   from   /usr/src/linux-2.4.20-8/include/linux/fs.h:26,
                                  from   /usr/src/linux-2.4.20-8/include/linux/capability.h:17,
                                  from   /usr/src/linux-2.4.20-8/include/linux/binfmts.h:4,
                                  from   /usr/src/linux-2.4.20-8/include/linux/sched.h:10,
                                  from   short.c:29:
/usr/include/asm/bitops.h:327:2:   warning:   #warning   This   includefile   is   not   available   on   all   architectures.
/usr/inclu