mini2440 -- TFTP方式下载内核镜像(uImage)--开发用

本文档详细介绍了如何在Mini2440开发板上通过TFTP下载内核镜像(uImage)的过程。首先,修改内核根目录的Makefile,然后配置内核并选择编译方法(生成zImage或uImage)。接下来,设置u-boot环境参数,包括IP地址、服务器IP和网关IP。最后,通过TFTP将uImage下载到开发板的外部RAM并启动内核。
摘要由CSDN通过智能技术生成
#仅适用于友善提供的Mini2440开发板内核源码!!!


1.修改内核根目录Makefile(友善已修改):
#ARCH ?= $(SUBARCH)
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-


2. 拷贝内核配置文件:
$ cp config_mini2440_p35 .config


3. 配置内核:
$ make menuconfig


4. 编译内核(3种方法):
(方法1)$ make //生成zImage
...
Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready
  Building modules, stage 2.
  MODPOST 18 modules


或(方法2)$ make zImage //生成zImage
...
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready


或(方法3)$ make uImage //生成zImage + uImage
...
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-2.6.32.2-FriendlyARM
Created:      Sun Jun 15 17:38:32 2014
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2268716 Bytes = 2215.54 kB = 2.16 MB
Load Address: 30008000
Entry Point:  30008000
  Image arch/arm/boot/uImage is ready


5. 启动u-boot(重启开发板并按一次任意键),并设置u-boot环境参数:


U-Boot 2010.03 ( 4鏈20 2014 - 11:20:52)


 modified by tekkamanninja (tekkamanninja@163.com)
 Love Linux forever!!


I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  256 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 //进入shell
[u-boot@MINI2440]# 


//查看当前环境参数设置
[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
stdin=serial
stdout=serial
stderr=serial
ethact=dm9000
Environment size: 313/131068 bytes


//设置通过NFS启动文件系统(如不使用NFS文件系统则忽略此句)
[u-boot@MINI2440]# setenv bootargs console=ttySAC0 root=/dev/nfs nfsroot=192.168.1.110:/rootfs_qtopia4 ip=192.168.1.230:192.168.1.110:192.168.1.1:255.255.255.0:S3C2440A:eth0:off


//设置环境参数
[u-boot@MINI2440]# setenv ipaddr 192.168.1.230 //开发板(target)IP
[u-boot@MINI2440]# setenv serverip 192.168.1.110 //开发主机(host)IP(FTP & NFS服务器所在主机)
[u-boot@MINI2440]# setenv gatewayip 192.168.1.1 //网关IP
[u-boot@MINI2440]# saveenv //保存设置(至开发板nand flash)


Saving Environment to NAND...
Erasing Nand...
Erasing at 0x40000 -- 100% complete.
Writing to Nand... done


6. 通过TFTP下载内核镜像(至开发板外部RAM(64M bytes)):


[u-boot@MINI2440]# tftp 0x30008000 uImage


dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.110; our IP address is 192.168.1.230
Filename 'zImage'.
Load address: 0x30008000
Loading: T #################################################################
         #################################################################
         #########################
done
Bytes transferred = 2268716 (229e2c hex)


7. 启动内核(启动地址(实际的内核代码存放地址)=0x30008000(uImage镜像文件入口地址)+0x40(uImage文件头部大小)):


[u-boot@MINI2440]# bootm 0x30008040


Starting kernel ...


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值