S3c6410 linux内核移植(1)---下载与配置

一、 下载内核及交叉编译工具

(1)http://git.kernel.org/?p=linux/kernel/git/kki_ap/linux-2.6-samsung.git;a=summary到以上地址下载linux内核的三星分支,这里选取“2.6.28-samsung”版本。

(2) 安装4.3.1-eabi-armv6编译器.

http://cs.sch.ac.kr/~choicjy/entry/MV6410-Samsung-Arm-linux-toolchain 4.3.1-eabi-armv6是三星官方为其armv6架构处理器维护的一套编译器,不过我 装起来遇到不少麻烦

首先是执行arm-linux-gcc报错
[kyon@SEP4020 bin]$ arm-linux-gcc
arm-linux-gcc: no such files or directory
[kyon@SEP4020 bin]$

解决方法:必须将该编译器解压到/usr/local/arm/目录,因为里面有很多地方指明了绝对路径
其次是make提示mpfr库找不到
[kyon@SEP4020 m8-android-kernel]$ make
CHK     include/linux/version.h
make[1]: “include/asm-arm/mach-types.h”是最新的。
CHK     include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC      kernel/bounds.s
/usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../libexec/gcc/arm-samsung-linux-gnueabi/4.3.1/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2

解决方法:其实是有这个库的,就在/usr/local/arm/4.3.1-eabi-armv6/mpfr/lib
在.bashrc中添加一个环境变量
export LD_LIBRARY_PATH=/usr/local/arm/4.3.1-eabi-armv6/mpfr/lib
然后在source .bashrc即可
最后来看这个编译器有啥好处:

[kyon@SEP4020 ~]$ arm-linux-gcc -v
Using built-in specs.
Target: arm-samsung-linux-gnueabi
Configured with: /home/scsuh/workplace/final/toolchain-script/toolchain_build_arm/gcc-4.3.1/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-samsung-linux-gnueabi --enable-languages=c,c++ --with-sysroot=/usr/local/arm/4.3.1-eabi-armv6 --with-build-time-tools=/usr/local/arm/4.3.1-eabi-armv6/usr/arm-samsung-linux-gnueabi/bin --enable-__cxa_atexit --enable-target-optspace --with-gnu-ld --with-pkgversion='for S3C64XX Samsung Electronics AP Development Team' --enable-shared --with-gmp=/usr/local/arm/4.3.1-eabi-armv6/gmp --with-mpfr=/usr/local/arm/4.3.1-eabi-armv6/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-arch=armv6 --with-float=softfp --with-fpu=vfp --enable-symvers=gnu
Thread model: posix
gcc version 4.3.1 (for S3C64XX Samsung Electronics AP Development Team)

a编译时默认使用硬件浮点单元--with-float=softfp --with-fpu=vfp
b默认架构armv6 --with-arch=armv6 
c有自己的mpfr库,等等.

另外可到http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite 网址下载最新的交叉编译器当前版本是“gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202”。

(3)修改Makefle文件,把arch 改为arm 把CROSS_COMPILE改为arm-none-linux-gnueabi-gcc,当然最简单的方法是从开发板厂商那里获取内核和交叉编译器。

二、 配置

这里推荐一方法,调用arch/arm/configs 目录下的默认配置单smdk6410mtd_defconfig为基础进行配置,同时可以参考现有的文档和配置单进行配置,注意点:

(1)要添加ubifs文件系统支持时应先配置device driver->memory technology device下的ubi项。

(2)device drivers->character device->serial drivers: 选中samsung soc serial support取消8250……(否则会出现错误:arch/arm/plat-s3c/init.c:94: error: 'CONFIG_SERIAL_SAMSUNG_UARTS' undeclared here (not in a function));

(3)system type->os timer support: 选中fixed tick timer(否则会出现错误:arch/arm/plat-s3c/time.c error)

(4)cpu power management:cpu frequency scaling项取消选中(否则会出现错误:arch/arm/plat-s3c/clock.c error)

配置好后要备份配置文件,保存为ctop6410_defconfig

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值