cygwin 编译linux内核,Cygwin编译ARM Linux内核

~~Cygwin配置

在d:\cygwin\cygwin.bat中加入set CYGWIN=title ntea

cd /bin

mv sh.exe sh-original.exe

ln –s bash.exe sh.exe

~~升级内核补丁

- You can also upgrade between 2.6.xx releases by patching. Patches are

distributed in the traditional gzip and the newer bzip2 format. To

install by patching, get all the newer patch files, enter the

top level directory of the kernel source (linux-2.6.xx) and execute:

gzip -cd ../patch-2.6.xx.gz | patch -p1

or

bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1

~~Make Menuconfig Issue

~~~scripts/basic/fixdep ERROR

$ make menuconfig

HOSTCC scripts/basic/fixdep

scripts/basic/fixdep.c: In function `parse_config_file':

scripts/basic/fixdep.c:244: warning: array subscript has type `char'

scripts/basic/fixdep.c: In function `parse_dep_file':

scripts/basic/fixdep.c:325: warning: array subscript has type `char'

scripts/basic/fixdep: scripts/basic/fixdep: cannot execute binary file

make[1]: *** [scripts/basic/fixdep] Error 126

make: *** [scripts_basic] Error 2

由于生成了fixdep和fixdep.exe,删除scripts/basic/fixdep,让调用fixdep.exe,以及

scripts/basic/docproc,scripts/Kconfig/mconf

--修改顶层目录下Makefile文件,

SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \

-e s/arm.*/arm/ -e s/sa110/arm/ \

-e s/s390x/s390/ -e s/parisc64/parisc/ \

-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \

-e s/sh[234].*/sh/ )

SUBARCH := arm

...

CROSS_COMPILE ?= /usr/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-

~~~make menuconfig找不到头文件

scripts/kconfig/lxdialog/dialog.h:32:20: curses.h: No such file or directory

在编译内核用make menuconfig时出现:curses.h:No such file or directory

安装glibc-devel、Utils/ncurses、Devel/libncurses-devel这3个包

默认Cygwin没有glibc安装文件,暂时不装。

~~现在,应该可以进入Menuconfig界面了,只能通过键盘方向键控制选择,连击ESC两次,返回上级菜单直至退出。

配置System Type等

~~make uImage,生成内核镜像

删除,scripts/Kconfig/conf

~~~

include/linux/sched.h:47: fatal error: asm/param.h: No such file or directory

symlink文件include/asm存在,但是不起作用。

~~~

直接在modepost.c里加上:

//copy from kernel.git\include\asm-x86\elf.h

#define R_386_32 1

#define R_386_PC32 2

//copy from kernel.git\include\asm-arm\elf.h

#define R_ARM_PC24 1

#define R_ARM_ABS32 2

//copy from kernel.git\include\asm-mips\elf.h

#define R_MIPS_32 2

#define R_MIPS_26 4

#define R_MIPS_HI16 5

#define R_MIPS_LO16 60b1331709591d260c1c78e86d0c51c18.png

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值