设为首页 加入收藏

TOP

Cygwin编译ARM Linux内核
2014-11-24 02:38:51 来源: 作者: 【 】 浏览:1
Tags: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 6


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Java中char到底是多少字节? 下一篇简易的Java浏览器之开发感想

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: