Setting up an embedded target

In order to access an embedded target using Phindows, you must ensure that your embedded target is properly configured and that your buildfile contains at least the minimum set of required components. This topic provides an example of a basic buildfile.

Note: Before you configure your target for remote access, it's a good idea to set up photon locally. This ensures that most of the necessary components that are required for remote access will be already present. If you run into problems, use the -D option of phrelay to troubleshoot your installation.

The following components are required in order to allow Phindows to connect to your embedded target:

In your inetd.conf file, add the following entry:
phrelay stream tcp nowait root /path_name/phrelay phrelay -x

where path_name is the correct path to phrelay. By default, phrelay is located in the following location: /usr/bin/phrelay.

In order to enable a private Phindows session, you must be able to log on. Ensure that you have the proper files installed:: You can verify that remote log in works by starting a telnet session with your target. If your telnet connection is successful, you can always remove telnetd and any related files.
The following listing shows a startup script that contains only the most basic components required to support a Phindows connection:
###########################################################
##
## NOTES: A simple build script to allow a Phindows 
##        connection on an embedded device.
##
###########################################################

###########################################################
## START OF BUILD SCRIPT 
###########################################################

inetd
phrelay
/etc/services
Note: You must also include the phlogin2 binary file that gets invoked by phrelay when a private Phindows session is created. The phlogin2 binary executes a ph script which must be present in the following location /usr/bin/ph. Either create a local version of phrelay or create links to the following locations in your buildfile:
/usr/photon/bin/Photon
/usr/photon/bin/phlogin 
#or phlogin2
The following files are required by phlogin2: These files should already be present if Photon is running on your target.
In the ph script, export the Photon environment variables and start the Photon components as you would from a startup script. Note that you should not start or restart io-display or io-graphics. Include the following script in your buildfile:
###########################################################
## START OF ph SCRIPT 
###########################################################
export PATH=/proc/boot:/bin:/sbin:/usr/bin:/usr/sbin:/usr/photon/bin
export PHOTON_PATH=/usr/photon
export PHFONT=/dev/phfont
export HOME=/root
waitfor $PHOTON
if test ! $PHOTON -ef $PHOTON; then
print "Unable to start windowing kernel.\n"
exit 1
fi
    
pwm &
bkgdmgr &
sleep 1
shelf &

Make sure to include the following fonts, otherwise the login screen will not appear:

###########################################################
## font support 
###########################################################
/usr/photon/font_repository/pcs12.phf
/usr/photon/font_repository/pcterm14.phf
/usr/photon/font_repository/pcterm12.phf
/usr/photon/font_repository/phcursor.phf
/usr/photon/font_repository/tt0005m_.ttf
/usr/photon/font_repository/tt2003m_.ttf
/usr/photon/font_repository/tt2001m_.ttf

These are the basic requirements for connecting to an embedded device with Phindows.