Chinaunix首页 | 论坛 | 博客
  • 博客访问: 407344
  • 博文数量: 121
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1393
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-11 12:17
个人简介

www.vibexie.com vibexie@qq.com

文章分类

全部博文(121)

文章存档

2015年(55)

2014年(66)

我的朋友

分类: 嵌入式

2014-11-10 14:57:16

1.安装tftp服务器
   [root@vibexie vibe]# yum install tftp tftp-server
2.配置tftp服务器
    编辑/etc/xinetd.d/tftp文件
    [root@vibexie xinetd.d]# vi tftp
 

点击(此处)折叠或打开

  1.  # default: off
  2.  # description: The tftp server serves files using the trivial file transfer \
  3.  # protocol. The tftp protocol is often used to boot diskless \
  4.  # workstations, download configuration files to network-aware printers, \
  5.  # and to start the installation process for some operating systems.
  6.  service tftp
  7.  {
  8.  socket_type = dgram
  9.  protocol = udp
  10.  wait = yes
  11.  user = root
  12.  server = /usr/sbin/in.tftpd   
  13.  server_args = -s /home/vibe/tftp -c  /*修改项server_args= -s        -c,其中处可以改为你的tftp-server的根目录,参数-s指定chroot,-c指定了可以创建文                                        件。*/
  14.  disable = no   /*默认为yes,表示关闭tftp服务器,我们修改为no,表示开启*/
  15.  per_source = 11
  16.  cps = 100 2
  17.  flags = IPv4
  18.  }
修改上述注释的两项即可,其他想了解的话可以百度下。

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
阅读(1953) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~