The tftp server

 

PMON2000 R3.x can be configured to provide tftp server functionality to upload and download files to the onboard flash or filesystem.

Starting the server

The built in tftp server can be started automatically or from the command prompt. When started automatically it will be run in the background servicing requests from a client to upload or download files. For example the autoboot sequence can be set to go into tftp mode if no loadable file can be found on the target system thus make an initial setup to work without having access to the console on the target. When in this mode the target can set up to announce its existens by broadcasting a special packet.

Upload and execute code

This method can be used to upload code to the ram memory and execute it. This works like a push load. The client put up a file to the target to the  /dev/ram/usermem destination. The file is stored in RAM and when the upload have completed the file integrity is verified by checking the CRC32 which should be appended to the file. A tool for Linux and BSD called prepimg is available in the PMON2000 source tree in the tools directory. If the CRC32 is correct the uploaded file is checked for ELF or binary format. An ELF format file is loaded the same way as from a local media on the target itself. A binary file is executed in the same place as it was loaded and must either be linked to start at the proper location or be in PIC. Additionally a signature can be used as a key to verify the uploaded file. The signature is 64 bit and is stored in the signature environment variable.

Upload and program flash

To upload a file an program it to flash the destination should be /dev/flash@addr where addr is an offset relative to the configuration definition of USERFLASH_BASE. The file is stored in RAM and when the upload have completed the file integrity is verified by checking the CRC32 which should be appended to the file. A tool for Linux and BSD called prepimg is available in the PMON2000 source tree in the tools directory. If the CRC32 is correct the uploaded file is programmed into flash and then the CRC32 of the programmed data is verified. The signature can also be used here to verify the file type.

Upload and save

All other destination for an upload will be to a filesystem on the target.

Environment

This function uses the signature environment variables affect this function.

See Also

 

Powered by Drupal, an open source content management system