(六)uboot引导启动内核

 U-BOOT 给linux 内核传递合适参数的定义,在include/configs/mini2440.h 
#define CONFIG_SETUP_MEMORY_TAGS 1
#define CONFIG_INITRD_TAG 1
#define CONFIG_CMDLINE_TAG 1

制作uImage

 添加变量

setenv tftp 0x30008000 uImage;bootm

save 

设置TFTP

linux上 tftp 建立

对网络的配置文件进行编辑

[root@centos /etc/sysconfig/networking/devices]$gedit ifcfg-eth0 &

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static //这个应该是“static”,而不是“dhcp”或“none”;
HWADDR=00:0C:29:E7:A4:D5
ONBOOT=yes
DHCP_HOSTNAME=centos.ocaldomain
IPADDR=192.168.1.102
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
然后重新激活下网卡就可以了.

#service iptables stop  

 #service iptables status

#service network restart

Tfpt服务安装

1:挂载光盘

2:由于tftp跟xinetd有关,因此首先安装xinetd rpm.

[root@centos /media/CentOS_5.5_Final/CentOS]$ls |grep xinet*

xinetd-2.3.14-10.el5.i386.rpm

之后再安装 tftp rpm

[root@centos/media/CentOS_5.5_Final/CentOS]$rpm -ivh tftp-server-0.49-2.el5.centos.i386.rpm

3:修改配置文件 /etc/xinetd.d/tftp

[root@centos /etc/xinetd.d]$vi tftp

# default: off

# description: The tftp server serves files using the trivial file transfer

#       protocol.  The tftp protocol is often used to boot diskless

#       workstations, download configuration files to network-aware printers,

#       and to start the installation process for some operating systems.

service tftp

{

         socket_type              = dgram

         protocol            = udp

         wait                    = yes

         user                    = root

         server                         = /usr/sbin/in.tftpd

        server_args              = -s /tftpboot       //为内核uImage存放的位置与shell zImage_to_uImage.sh中最终生成uImage的位置相同

         disable                       = yes  -àno

         per_source                = 11

         cps                      = 100 2

         flags                            = IPv4

}

4:重新启动xinetd服务

[root@centos /media/CentOS_5.5_Final/CentOS]$ /etc/init.d/xinetd restart

之后uboot通过tftp下载内核uImage可以顺利进行了。

u-boot@MINI2440]# tftp 0x30008000 uImage
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 12:34:56:78:90:ab
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.102; our IP address is 192.168.1.103
Filename 'uImage'.
Load address: 0x30008000
Loading: T #################################################################
  #################################################################
  #########################
done
Bytes transferred = 2268652 (229dec hex)

启动 

原文地址:https://www.cnblogs.com/liuchengchuxiao/p/4321079.html