Chinaunix首页 | 论坛 | 博客
  • 博客访问: 91247
  • 博文数量: 19
  • 博客积分: 760
  • 博客等级: 军士长
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-30 16:30
文章存档

2011年(1)

2009年(18)

我的朋友

分类: 嵌入式

2009-08-07 15:32:14

6        使用uboot下载引导内核

6.1        制作uImage(tftp目录下存在zImage文件)

~/u-boot-1.3.1$ sudo cp tools/mkimage /usr/bin/

~/u-boot-1.3.1$ cd /home/example/tftp/

$ ./mkimage -A arm -O linux -T kernel -C none -a 30080000 -e 30080000 -n linux-2.6.14.1_ds9000 -d zImage uImage

Image Name:   linux-2.6.14.1_ds9000

Created:      Sat Nov 29 16:21:35 2008

Image Type:   ARM Linux Kernel Image (uncompressed)

Data Size:    1785268 Bytes = 1743.43 kB = 1.70 MB

Load Address: 0x30080000

Entry Point:  0x30080000

6.2        查看uboot支持命令

[ edukit2410]# help

6.3        查看启动参数是否配置正确

[ edukit2410]# printenv

bootdelay=3                                                                     

baudrate=115200                                                                 

ethaddr=08:00:3e:26:0a:5b                                                       

netmask=255.255.255.0                                                           

ipaddr=192.168.2.199                                                            

serverip=192.168.2.34                                                           

bootargs=console=ttySAC1 root=/dev/mtdblock/3 rootfstype=yaffs                 

bootcmd=tftp 30800000 uImage                                                

stdin=serial                                                                    

stdout=serial                                                                   

stderr=serial                                                                                                                                        

Environment size: 256/65532 bytes 

如果要修改参数请使用setenv命令。比如要设置新的ipaddr

[ edukit2410]# setenv ipaddr 192.168.2.199                                      

[ edukit2410]# saveenv                                                          

Saving Environment to NAND...                                                   

Erasing Nand...Writing to Nand... done                                         

[ edukit2410]#

6.4        下载uImage到指定位置,并启动内核

[ edukit2410]# tftp 30800000 uImage                                             

dm9000 i/o: 0x20000000, id: 0x90000a46                                         

MAC: 08:00:3e:26:0a:5b                                                         

operating at 100M full duplex mode                                             

TFTP from server 192.168.2.34; our IP address is 192.168.2.199                 

Filename 'uImage'.                                                             

Load address: 0x30800000                                                       

Loading: ##########################################################################################################  ###############################################################################################################################################################

done                                                                            

Bytes transferred = 1785332 (1b3df4 hex) 

[ edukit2410]# bootm

这样就完成了利用uboot下载并引导内核。

http://blogimg.chinaunix.net/blog/upfile2/090807160102.rar

阅读(1749) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~