S3C2440上移植内核之编译Linux2.6.31出现问题

来源:互联网 发布:axure mac 编辑:程序博客网 时间:2024/06/05 01:09

编译环境:WIN7+REDHAT9.0

内核版本:Linux2.6.31

交叉编译工具:arm920t-eabi(4.1.2)

一、拷贝内核源码Linux-2.6.31.tar.bz2到Linux主机/home/文件夹下,tar  xjvf Linux-2.6.31.tar.bz2解压到当前文件夹。

二、安装交叉编译工具到/usr/local/arm到文件夹下,vi /etc/profile    添加   export PATH=/usr/local/arm/arm920t-eabi/bin:$PATH 指定交叉编译工具 然后执行source  /etc/profile 

三、修改内核源码根目录下 Makefile: 183 行: 
ARCH ?= arm 
CROSS_COMPILE ?= arm-linux-

四、修改时钟: 
修改 arch/arm/mach-s3c2440/mach-smdk2440.c 163 行 
static void __init smdk2440_map_io(void) 

s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc)); 
s3c24xx_init_clocks(12000000); 
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs)); 

五、配置内核

#make menuconfig 
进入 Load an Alternate Configuration File 
输入 2440 的默认配置文件:arch/arm/configs/s3c2410_defconfig OK 
在 System Type 选单下,s3c24XX Machine 那部分,只选中 
SMDK2410/A9M2410 
SMDK2440 
SMDK2440 with S3C2440 cpu moudle 
保存配置文件为:.config 

六、make uImage

出现以下错误,

/bin/sh: line 1: arm-linux-nm: command not found
No valid symbol.
make: *** [.tmp_kallsyms1.S] Error 1

这是因为交叉编译工具的bin目录下没有arm- linux-nm 这时可以进入交叉编译bin目录下执行ln -s arm-angstrom-linux-gnueabi-nm arm-linux-nm建立软连接

修改完成后出现

/bin/sh: line 1: arm-linux-objcopy: command not found
make[1]: *** [arch/arm/boot/Image] Error 127
make: *** [uImage] Error 2

同上执行ln -s arm-angstrom-linux-gnueabi-objcopy arm-linux-objcopy 

修改完成后重新make uImage

又出现"mkimage" command not found - U-Boot images will not be built
  Image arch/arm/boot/uImage is ready

不能生成uImage

这里需要安装uImage生成工具进入uboot1.1.6 tools目录下拷贝mkimage工具到交叉编译工具bin目录下

编译OK


0 0