在烧写好u-boot后,重新启动mini2440,一直按空格键进入u-boot界面:
U-Boot 2010.03 ( 5月 06 2014 - 21:18:31) modified by tekkamanninja (tekkamanninja@163.com) Love Linux forever!! I2C: ready DRAM: 64 MB Flash: 2 MB NAND: 128 MiB In: serial Out: serial Err: serial USB slave is enable! Net: dm9000 Hit any key to stop autoboot: 0 ##### FriendlyARM U-Boot(2012-07) for 2440 ##### [f] Format the nand flash [v] Download u-boot.bin [k] Download Linux kernel [y] Download root yaffs2 image [a] Download Absolute User Application [s] Set the boot parameter of Linux [b] Boot Linux [r] Reboot [q] Quit to shell Enter your Selection:
输入'q'键并回车即可进入u-boot控制台。
然后执行'printenv'命令查看环境变量信息,显示如下:
[u-boot@MINI2440]# printenv bootargs=noinitrd root=/dev/mtdblock3 console=ttySAC0 init=/linuxrc bootcmd=nand read.i 0x30008000 60000 500000;bootm bootdelay=1 baudrate=115200 ethaddr=08:08:11:18:12:27 ipaddr=192.168.0.230 serverip=192.168.0.1 gatewayip=192.168.0.1 netmask=255.255.255.0 ethact=dm9000 filesize=0 stdin=serial stdout=serial stderr=serial Environment size: 324/131068 bytes
默认的网络所在的段属于192.168.0,而我的路由器默认设置为192.168.211.1,主机ip地址为192.168.211.2,所以需要修改环境变量
执行以下命令:
[u-boot@MINI2440]# setenv ipaddr 192.168.211.211 [u-boot@MINI2440]# setenv serverip 192.168.211.2 [u-boot@MINI2440]# setenv gatewayip=192.168.211.1
[u-boot@MINI2440]# saveenv
然后将需要tftp下载的文件复制到tftp配置的文件夹内(我拷贝的是uImage文件),并将权限设置为777(chmod 777 uImage)。
然后重启tftp服务:
sudo /etc/init.d/tftpd-hpa restart
在u-boot下执行‘tftpboot'命令:
[u-boot@MINI2440]# tftpboot 31000000 uImage
这时可以看到,文件成功加载到0x31000000位置,然后可以执行'bootm 0x31000000'启动内核(我虽然启动了内核,但是执行一下就死掉了,可能是bootargs参数设置不正确)。