TFTP Client Example

peter.o.mueller at gmx.de peter.o.mueller at gmx.de
Thu Apr 19 15:47:47 UTC 2001


Does anyone use this to download user code and executes it afterwards? In
our case this could speed up development a lot: just press reset, code in rom
downloads the application, starts it, user monitors output ...

Peter


> Gerke Kok wrote:
> > 
> > I think you could have a look at the tftp client in the 'etherboot'
> 
> Yes, but RTEMS already has a TFTP `network file system' driver which
> makes access to files on a TFTP server almost the same as access to any
> other file.  Usage is very simple:
>     1) After initializing the network, register the TFTP driver:
>         rtems_bsdnet_initialize_network ();
>         rtems_bsdnet_initialize_tftp_filesystem ();
> 
>     2) Remote files are opened by prepending /TFTP/server_address/ to
> the paths:
>          open ("/TFTP/128.233.xx.yy/path/name', 0);
>        or
>          fopen ("/TFTP/128.233.xx.yy/path/name', "r");
> 
>     3) Then just read/fread/getc as for any other file.
>         No seek operations, though.
>         A file can be open for reading or writing, but not both.
>         Opening a file for writing must meet the TFTP restrictions
> (already exist on server, world writeable).
> 
>     The above calls will open /tftpboot/path/name on my TFTP server,
> since the TFTP daemon has been started with:
>         /usr/sbin/in.tftpd -s /tftpboot
> -- 
> Eric Norum                                 eric.norum at usask.ca
> Department of Electrical Engineering       Phone: (306) 966-5394
> University of Saskatchewan                 FAX:   (306) 966-5407
> Saskatoon, Canada.
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




More information about the users mailing list