Welcome to Phindows

Phindows is a connectivity tool that allows users on Win32s platforms to connect to and interact with graphical Photon applications running on a remote QNX computer. Win32s platforms known to work with Phindows are:

- Windows 95

- Windows NT

- OS/2 (inside Win32s emulator)

- Windows 3.11 (with both Win32s and WINSOCK installed).

Installing Phindows

You install Phindows onto a Windows computer by running  A:\INSTALL   from the supplied Phindows floppy diskette.

The Phindows install program copies the necessary files into the \USR\PHOTON directory. It also creates a FONT and CACHE directory there for placing cached Photon font and image data. It is a good idea to make a Phindows icon as well.

Starting Phindows

To launch Phindows, click on the Phindows icon (or run \USR\PHOTON\PHINDOWS.EXE).

Phindows will then pop up a Connect dialog where you can specify the type of connection (TCP/IP or direct-connect serial). Various connection options are available, but the defaults will usually work well.

Once youve chosen the connection parameters, click on Apply to cause Phindows to connect with these parameters. To permanently record these setting before making the connection, click on  Apply & Save. These saved settings will become the default settings for all future Phindows sessions.

If a TCP/IP connection is requested, then the Internet address of the QNX computer youre connecting to must also be specified (e.g.: 198.53.31.1). If the remote computer has been configured properly, you should see a Photon login prompt, at which point you are connected and running Photon!

If a serial connection is requested (Windows 95 and NT only), then you must specify the COM port (e.g.: COM1 or COM2). If you dont specify a  baud rate, the current Windows default settings will be used. With a serial connection, Phindows initially acts as a simple text terminal that lets you type commands directly to the modem (e.g.: ATDT1-613-591-0934). Once connected, you should login to QNX and then issue the command:

/usr/photon/bin/phrelay

This will cause Phindows to drop out of text-terminal mode and begin acting as a Photon graphical terminal. A Photon login screen should appear at this point.

Configuring for TCP/IP Use

If TCP/IP is being used, there are several configuration issues that need to be taken care of before you can use Phindows.

First, the remote QNX host must have TCP/IP installed and running. In addition, inetd must be running  with the following additional items added to the indicated TCP/IP configuration files:

In /etc/inetd.conf, add the line:

phrelay stream tcp nowait root /usr/photon/bin/phrelay phrelay

In /etc/services, add the line:

phrelay 4868/tcp

These two entries will cause inetd to listen for incoming requests to establish a new Photon session. When a request is detected (from a remote Phindows client in our case), inetd will automatically establish a full TCP/IP connection and launch phrelay on that connection. Phindows will then be fully connected to the local machine.

All that remains now is to configure the Windows client to support TCP/IP. The exact way to do this depends on the type of Windows platform youre using, what services have already been installed on that client, and whether Ethernet or dialup networking over SLIP/PPP is being used (see the Microsoft documentation for help with this).

In general, Windows 95 and Windows NT come ready to use TCP/IP out of the box. Windows 3.11 platforms can use Phindows over TCP/IP, but both Win32s and WINSOCK must be installed and working first (both of these are available free of charge from the Microsoft ftp site ftp.microsoft.com).

Data Compression Options

The Phindows Connect dialog lets you specify one of three data compression options:

1) 	Byte-Pair Encoding (BPE) performs the best data compression and is recommended for all serial connections. Although BPE is inexpensive to decode (both in memory and CPU usage), it does require a fair amount of CPU on the host QNX machine. When link speeds are low (such as with modem links), the extra cost in CPU on the sending side is well worth the tradeoff.

2) 	Run Length Limited (RLL) provides good data compression. Although not as highly compressed as BPE, RLL encoding is both quick to decode and encode. RLL encoding is recommended for network TCP/IP connections because it places less CPU load on the QNX host, yet provides fair compression.

3) 	None. With data compression turned off, Photon draw events will be transmitted as is. This might make sense if the connection bandwidth is VERY high (say 100Mb Ethernet), making the extra processing time involved in data compression an unnecessary step.

Data Caching Options

Phindows makes very extensive use of data caching techniques to minimize the amount of data that needs to be transmitted from the host to the client machine. Thanks to this intensive data caching, Phindows is usable even on modem-link speeds as low as 9600 baud!

Most large static data objects in Photon are tagged with a unique 32-bit id (tag). Tagged objects include bitmap data, image data, and color palettes. These objects are generally tagged when first created by the Photon program developers. This process is accomplished automatically by the Photon development tools, so the program developer is, for the most part, not even aware that this is taking place.

Photon passes these tags along with the data objects as they flow through the Photon event space. The end result is that Photon graphics drivers (such as phrelay) will almost always have available a small, unique, precalculated tag to identify the larger Photon graphical objects.

Phrelay (the host side of a Phindows connection) has the job of transmitting the graphical Photon events over a communications link to a Phindows client. Phrelay and Phindows use a private protocol that allows these large graphical objects to be sent only once to the remote client. All subsequent references to that data object are made by passing the small tag, knowing that the Phindows client has a local copy of the entire data object. Over time, commonly encountered objects (such as icons and backdrops) will all be cached.

Phindows not only caches these tagged data objects in local memory, but also spills least-recently used objects to disk automatically and saves all cached objects to disk when Phindows is closed. The next time Phindows starts up, it preloads its in-memory cache from the most recently encountered disk cache and informs the remote phrelay session which objects it already knows about. This means that once a graphical object is seen once within Phindows, it will, in general, never have to be transmitted again, even in subsequent Phindows sessions.

The Phindows Connect dialog lets you tune the sizes of the in-memory data cache and of the maximum amount of disk storage to reserve for most recently encountered objects. The default values of 1024K for RAM cache and 20M for disk cache are usually adequate.

Command-line Options

PHINDOWS.EXE supports several command-line options. These parameters are usually added to the command when you create the Icon or Shortcut to launch Phindows. The options are:

-t inet_addr	TCP/IP address of QNX host (e.g.: 198.53.31.1).

-m commport	Direct connect serial port (default: com1)

-b baud [,commbaud]   Specify the effective link speed. If a direct serial connection is used

 	then the comm ports baud rate will be set to this value as well unless 	a specific baudrate is given (commbaud). If no baud is specified 	then the Windows default is used.

-n node	Connect to already running Photon on specified node (see below)

-u	Unlocked mode (allows independent browsing of Photon session)

-i igrp	Connect to a specific Photon input group (default: 1)

-x offset	Create Photon region at this x offset (default: 0)

-y offset	Create Photon region at this y offset (default: 0)

-h height	Initial window height (default: 460)

-w width 	Initial windows width (default: 620)

 -H  t1[,t2[,t3]]	Specify mouse holdoffs (default t1=1.2*9600/baud, t2=t1/2, t3=t1/4).

t1 is the holdoff time for normal mouse motion.

t2 is the holdoff time when the a mouse button is pressed.

t3 is the holdoff time when a drag cursor is being moved.

 -K   key	Specify a private key for data encryption.

 -s    service	Request this Photon service to be automatically started.

 -U   userid[:password]	Initially login to this QNX userid (used with -s).
 -k	Startup in kiosk (full screen) mode.

Note that if neither -t nor -m is specified, then Phindows will pop up the Connect dialog asking for communications parameters.

Dittoing Remote QNX Photon Sessions

The normal mode of using Phindows (without the -n option) causes a private session of Photon to be started on the QNX machine youve connected to. Photons  Jumpgates and Ditto facilities can be used to interact with other Photon sessions on that same QNX machine (or any other QNX machine in the same QNX network.), but your Photon session is otherwise independent of everyone else.

The -n command line option allows a Phindows client to see and interact with any Photon session already running on one of the QNX machines in the same QNX network youve connected to. An exact copy of the remote Photon users screen will be displayed on your Windows desktop. In addition, your mouse and keyboard can be used to interact directly with that remote Photon session. You can, in effect, take over the remote screen as if you were sitting there!

Remote Support Example

For example, if you wanted to provide support to a remote QNX site that is running Photon, you could dial up and login to that QNX machine using Phindows with a command line similar to:

phindows.exe -mcom2 -n/dev/photon

You would log in and start phrelay as follows:

/usr/photon/bin/phrelay

At this point, phrelay would be informed that a connection to an already existing Photon session called /dev/photon was being requested (i.e. the Photon running on the local console). Phrelay would create a graphics region to overlay the entire console graphics region, so that both your mouse and the remote mouse could control the same cursor. You would then be able to share that remote desktop with the remote user.

This type of remote connectivity is convenient for a variety of purposes, including:

- remote diagnostics

- remote monitoring

- remote technical support

- training.

Of course, theres no need to have a human actually sitting at the remote console. Nor is there a need to even have a physical screen and keyboard at the remote site.  You can use Photon connectivity to control remote sites that are completely unmanned. This not only saves on travel costs involved in remote diagnostics and maintenance, but also saves in hardware costs at the remote site (since the cost of keyboards and display screens can be eliminated).

Connecting to a Remote Photon Session

Suppose you needed to look at a Photon application running on some QNX machine other than the one with the modem youre connecting to. Not a problem. The -n option can specify the full QNX pathname of any Photon session on that remote QNX network. So if youre dialing into QNX node 1, but want to look at and interact with Photon running on node 2s console, just use:

phindows.exe  -n//2/dev/photon

When you connect to the QNX network (initially logged into node 1), and start:

/usr/photon/bin/phrelay

phrelay will recognize that you really want to be connected to a Photon on node 2, so it will automatically migrate itself to that node, but continue to use the modem you dialed in on (i.e. the modem on node 1). Since QNX is an inherently distributed operating system, this happens seamlessly and efficiently.

Starting Photon sessions on other QNX nodes

Suppose the QNX machine you log in to has lots of modems, but not a lot of spare CPU or memory. You want to start up a private Photon session and discover that node 2 has lots of spare resources (in QNX, any node will do). You can specify this with the following command:

phindows.exe  -n//2/dev/ph+

Spanning a Single Photon session across multiple screens

Phindows and phditto (which comes standard with Photon) can both be used to stretch a single Photon space across multiple desktops. Some (or all) of these desktops can be QNX computers, some (or all) of these desktops can be Windows desktops, and some (or all) can be X workstations as well (with the phinx program).

The -x, -y, -h and -w options are provided in both phditto and Phindows to make this possible. Heres how it works:

Suppose you had a QNX machine running Photon on a console in 1024x768 resolution. You now wanted to stretch the Photon space to include the 1024x768 Windows screen you have placed immediately to the right of the QNX screen (creating a 2048x768 Photon desktop). You would simply need to start up Phindows on the Windows machine with:

phindows.exe -x1024 -n/dev/photon

When the connection is made (TCP/IP works well), youll notice that the Photon desktop manager, which is normally on the bottom of the Photon screen, has stretched to include the bottom of the right-hand MS-Windows screen as well. You can now take either mouse, start up new applications, drag them from screen to screen, and otherwise take advantage of your increased workspace.

With careful use of -x, -y (and -h and -w) options, you could create many interesting combinations (an array of monitors forming one huge Photon display, multimedia presentations, etc.)

Sharing a Photon Session (Workgroup Computing)

The normal mode of Dittoing someone elses Photon session (-n specified) is to have a single cursor that can be controlled by either the local or remote user. Similarly, keystrokes from either keyboard can be entered into the application with keyboard focus, which is normally what you want for a remote training or debugging session.

But sometimes you may want the remote user to carry on working without necessarily being affected by what youre doing.  You can do this by specifying the -u option on the Phindows command line. In this mode, your mouse, keyboard, and display will be completely independent of the other users console. Both of you will see two cursors (your cursor will be solid, the other persons cursor will be dimmed or ghosted), but the two cursors will behave independently.

In Photon terminology, youll be running in your own private input group. Youre free to roam around the Photon space without affecting the other user. Your mouse clicks and keystrokes will be directed to whatever application has input focus for your input group. You can therefore start up new applications anywhere in the Photon space (probably in a different Photon console to be polite). Unless the other user chooses to roam over to the part of the desktop youre working in, he will otherwise be unaffected by your presence there.

Theres no built-in limit to how many concurrent users can share the same workspace in this manner, although its doubtful that youd practically want to have more than two at any one time. Its far more likely that if multiple users are connected to a single QNX machine. then they will each run in their own private Photon workspace (the default behavior of Phindows) and communicate with each other using the built-in Photon connectivity facilities (like Jumpgates, phditto, and msgpad). A single QNX machine could easily support dozens of such Phindows clients, provided it was fast enough and had enough RAM.

Using Predefined Photon Services

The -s command-line option is provided to simplify the task of creating shortcuts to Photon applications within the Windows desktop.

By using the -s option you can create an icon or shortcut on the Windows desktop which will startup a Photon application automatically (within a private Phindows session). With proper specification of the remote Window manager options, it is possible to make that Photon application look like it is a native Windows application.

When phrelay runs on the QNX host machine, it will look up the Photon service specified with the -s parameter in a configuration file (/etc/config/phrelay[.node]). If a matching service is found, then phrelay will launch the specified Photon command instead of the default Photon desktop. Optional Window Manager options can be specified, but the default mode is to start the remote Photon

application such that it looks and behaves as if it were a native Windows application.

The -U option is usually used along with the -s option to specify a QNX userid to use when running the remote Photon command. If no userid is given, and the phrelay service doesnt specify a default userid, then Photon will popup a login dialog requesting the QNX userid before proceeding. By specifying a userid with the -U option, this login dialog can be avoided.

For example, if a Windows shortcut were created as follows:

phindows  -tx.x.x.x  -svpoker  -Ujoe

where the IP address x.x.x.x specified the TCP/IP address of  QNX node 2, and the phrelay configuration file on node 2 (/etc/config/phrelay.2) contained the following line:

vpoker  %  /usr/photon/bin/vpoker

then joe could directly launch a Photon vpoker session (running as QNX userid joe) on his Windows desktop by simply clicking on the icon/shortcut.

Phrelay Configuration File Format

The format of each service entry in the phrelay configuration file is as follows:

service	user	[-W pwm_options]	command

where:

service	is the symbolic name of the Photon service (matches the -s Phindows parameter)

command	is the Photon command to launch instead of the default Photon desktop.

user	can be one of:

userid	QNX userid (if no -U). Prompt for password if required.

userid:password	QNX userid and password (if no -U).

%	Prompt for user/password if no -U.

?	Always prompt for user/password (ignore -U).

!	Fail if no -U.

=userid	Force this userid (ignore -U).

=userid:password	Force this userid and password (ignore -U).

pwm_options	can be one or more of the following Photon Window Manager options:

P	Disable taskbar, console switching and keyboard.

W	Disable Workspace menu.

R  remote_option	Remote Window Manager options (see below).

where remote_option can be one or more of:

c	Close Window Manager when program terminates.

b	Remove Photon Window Manager borders.

t	Send Window title to Phindows.

f	Fit. Make application always fit in Phindows window).

r	Initially resize Phindows window to fit application.

m	Initially resize application to fit in Phindows window.

The default Window manager options are PWRcbtfr if none are specified.