移植修剪Linux系统到miniS3C2440开发板

通过TFTP工具在linux系统中移植内核到miniS3C2440开发板

首先是在linux系统中进行内核的配置和编译

获取内核源代码:

  1. 移植好的内核
  2. 从社区下载内核,完成移植http://www.kernel.org/pub/linux/kernel/v2.6/

然后借助Samba服务器,从Windows中复制内核源码包含到宿主机fedora共享目录

解压内核源码包

tar -xvzf linux-2.6.32.2.tar.gz

内核的配置:

1. 清除临时文件、中间文件和配置文件.进入linux-2.6.32.2文件夹里面执行命令参数:

make clean

remove most generated files but keep the config

make mrproper

remove all generated files + config files

make distclean

mrproper + remove editor backup and patch files

确定目标系统的软硬件配置情况,使用如下命令之一配置内核:

make config 基于文本模式的交互式配置 。

make menuconfig 基于文本模式的菜单型配置。(推荐使用

make oldconfig 使用已有的配置文件(.config ),但是会询问新增 的配置选项 。

make xconfig 图形化的配置(需安装图形化系统)

2.在原有配置文件的基础上进行配置修改,拷贝arch/arm/config_w35为文件.config

#cp config_mini2440_w35  .config

3.修改内核目录下的Makefile

ARCH   ?= arm

CROSS_COMPILE  ?= arm-linux-

4.执行make menuconfig定制内核组件,以root权限执行

内核的编译

#make zlmage

编译完成后,内核镜像文件zlmage生成在arch/arm/boot/目录下

zlmage转换成ulmage

注意:kernel内核文件开始的为zImage压缩的内核镜像文件,只能被supervivi识别,但不能被u-boot识别,故如果BootLoader为U-boot时必须将zImage转换为uImage

#make zImage

编译完成后,内核镜像文件zImage生成在/arch/arm/boot/目录

zImage转换为uImage

转换命令为:

mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008040 -n "Linux kernel Image by embedclub" -d zImage uImage

或者执行写好的执行文件mkz2uimage

内核的移植

在开发板2440中用u-boot命令进行移植:

内存地址位置:   u-boot: 0x0~0x40000

                            u-boot参数区:0x40000~0x60000

                            内核和文件系统:0x60000之后

进入mini2440开发板,进入U-boot后执行以下命令:

uImage拷贝至/tftpboot/

SecureCRT中依次输入:

u-boot@SMDK2440A> tftp 0x30008000 uImage

u-boot@SMDK2440A> nand erase 60000 500000

u-boot@SMDK2440A> nand write 0x30008000 0x60000 0x500000

/+++++++++++++++++++++++++++++++++附+++++++++++++++++++++++++++++++++++++++++++/

/***************通过tftp烧写u-boot.binnand FLASH*********/

u-boot.bin拷贝至/tftpboot/

SecureCRT中依次输入:

u-boot@SMDK2440A> tftp 0x30008000   u-boot.bin

u-boot@SMDK2440A> nand erase  0   60000

u-boot@SMDK2440A> nand write 0x30008000  0  0x60000

/********通过tftp烧写uImage内核到nand FLASH*************/

uImage拷贝至/tftpboot/

SecureCRT中依次输入:

u-boot@SMDK2440A> tftp 0x30008000 uImage

u-boot@SMDK2440A> nand erase 60000 500000

u-boot@SMDK2440A> nand write 0x30008000 0x60000 0x500000

/********通过tftp烧写YAFFS文件系统到nand FLASH*********/

root_qtopia.img拷贝至/tftpboot/

SecureCRT中依次输入:

u-boot@SMDK2440A>tftp  0x30008000  root_qtopia.img

// 通过tftp server下载root_qtopia.img至开发板内存0x30008000 地址处

u-boot@SMDK2440A> nand erase  0x560000  $filesize

//首先擦除Nand Flash从0x560000 开始,大小为0x3dac00的空间,来存放root_qtopia.img

u-boot@SMDK2440A> nand write.yaffs  0x30008000 0x560000 $filesize

//烧写root_qtopia.img至0x560000 开始的Nand Flash

u-boot@SMDK2440A> boot   //启动Linux系统

开发板设置:

启动uboot命令行,修改引导参数:

setenv bootargs console=ttySAC0 root=/dev/nfs nfsroot=192.168.1.102:/home/student/root_qtopia ip=192.168.1.226:192.168.1.102:192.168.1.102:255.255.255.0:SMDK2440A.arm9.net:eth0:off

保存配置:

saveenv

重新启动开发板Linux系统: boot

/*******************************************************/

启动YAFFS:

setenv bootargs noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0

saveenv

/*******************************************************/

小技巧: 通过word来复制setenv bootargs noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0, 可以消除换行符错误。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值