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

编程入门 行业动态 更新时间:2024-10-14 06:25:46

移植修剪Linux系统到miniS3C2440<a href=https://www.elefans.com/category/jswz/34/1769228.html style=开发板"/>

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

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

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

获取内核源代码:

  1. 移植好的内核
  2. 从社区下载内核,完成移植.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.bin到nand 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: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, 可以消除换行符错误。

更多推荐

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

本文发布于:2024-02-07 08:10:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1754536.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:开发板   系统   Linux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!