1.安装tftp服务器
[root@vibexie vibe]# yum install tftp tftp-server
2.配置tftp服务器
编辑/etc/xinetd.d/tftp文件
[root@vibexie 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 /home/vibe/tftp -c /*修改项server_args= -s -c,其中处可以改为你的tftp-server的根目录,参数-s指定chroot,-c指定了可以创建文 件。*/
-
disable = no /*默认为yes,表示关闭tftp服务器,我们修改为no,表示开启*/
-
per_source = 11
-
cps = 100 2
-
flags = IPv4
-
}
修改上述注释的两项即可,其他想了解的话可以百度下。
3.创建tftp服务器的根目录,并且其他组增加w权限
[root@vibexie ~]$ mkdir tftp
[root@vibexie ~]$ chmod o+w tftp
4.启动tftp服务器
[root@vibexie vibe]# systemctl start xinetd.service
5.测试
将一个文件放入tftp根目录中,如我放入lcd.bin
在目标板上下载linux tftp服务器中的lcd.bin
OpenJTAG> print
bootargs=noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
bootcmd=nand read.jffs2 0x30007FC0 kernel; bootm 0x30007FC0
bootdelay=2
baudrate=115200
ethaddr=08:00:3e:26:0a:5b
mtdids=nand0=nandflash0
mtdparts=mtdparts=nandflash0:256k@0(bootloader),128k(params),2m(kernel),-(root)
stdin=serial
stdout=serial
stderr=serial
partition=nand0,0
mtddevnum=0
mtddevname=bootloader
filesize=4788
fileaddr=30000000
netmask=255.255.255.0
ipaddr=192.168.1.110
serverip=192.168.1.107
Environment size: 477/131068 bytes
OpenJTAG> tftp 30000000 lcd.bin
ERROR: resetting DM9000 -> not responding
dm9000 i/o: 0x20000000, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
could not establish link
TFTP from server 192.168.1.107; our IP address is 192.168.1.110
Filename 'lcd.bin'.
Load address: 0x30000000
Loading: ####
done /*下载成功*/
Bytes transferred = 18312 (4788 hex)
OK!
如果在使用过程用遇到一些错误码,可参考http://blog.csdn.net/guozhiyuan20095318/article/details/7294810
阅读(2026) | 评论(0) | 转发(0) |