cygwin 编译linux内核,用cygwin编译内核模块的问题,急,在线等待!!

我在cygwin下用strong arm的交叉编译器编译下面的一个超简单的模块,结果问题多多。

/*hello.c*/

#include  /* We’re doing kernel work */

#include  /* Specifically, a module */

/* Deal with CONFIG_MODVERSIONS */

/*

#if CONFIG_MODVERSIONS==1

#define MODVERSIONS

#include

#endif

*/

/* Initialize the module */

int init_module()

{

printk("Hello, world - this is the kernel speakingn");

return 0;

}

void cleanup_module()

{

printk("Short is the life of a kernel modulen");

}

当我直接用cygwin的linux内核时,即如下的makefile

/*makefile*/

CC=arm-linux-gcc

LDFLAGS=-Xlinker -rpath-link /usr/local/lib/gcc-lib/arm-linux/2.95.2-6

LFLAGS-Wall -DMODULE -D__KERNEL__ -DLINUX

all: hello.o

hello.o: hello.c /usr/src/linux-2.4.19/include/linux/version.h

$(CC) hello.c $(LFLAGS) -c

没有什么错误,提示如下:

/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccm0CEMS.s: Assembler messages:

/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccm0CEMS.s:6: Warning: Ignoring changed section attributes for .modinfo

当我加上-I参数用新的内核编译的时候,即如下makefile

/*makefile*/

CC=arm-linux-gcc

LDFLAGS=-Xlinker -rpath-link /usr/local/lib/gcc-lib/arm-linux/2.95.2-6

LFLAGS=-I/usr/src/linux-2.4.19-sa1110/include -Wall -DMODULE -D__KERNEL__ -DLINUX

all: hello.o

hello.o: hello.c /usr/src/linux-2.4.19/include/linux/version.h

$(CC) hello.c $(LFLAGS) -c

出现如下错误:

In file included from /usr/src/linux-2.4.19-sa1110/include/linux/prefetch.h:13,

from /usr/src/linux-2.4.19-sa1110/include/linux/list.h:6,

from /usr/src/linux-2.4.19-sa1110/include/linux/module.h:12,

from hello.c:2:

/usr/src/linux-2.4.19-sa1110/include/asm/processor.h:50: warning: no semicolon a

t end of struct or union

/usr/src/linux-2.4.19-sa1110/include/asm/processor.h:50: parse error before `1'

/usr/src/linux-2.4.19-sa1110/include/asm/processor.h:52: parse error before `}'

/usr/src/linux-2.4.19-sa1110/include/asm/processor.h:56: field `insn' has incomp

lete type

make: *** [hello.o] Error 1

注:所用新的内核单独编译没有错误。

怎么办?

高手救我

3x very much!!

|

你的asm链接正确吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值