Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Running and Using Phindows.
Ref. No. QNX.000010298
Category(ies) Configuration
Issue How do I work with Phindows?
Solution Sharing a Photon Session (Workgroup Computing)

The normal mode of Dittoing someone else's 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 you're 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, you'll be running in your own private input group. Your

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 you're working in, he will otherwise be unaffected by your presence there.
There is no built-in limit to how many concurrent users can share the same workspace in this manner, although its doubtful that you would 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 does not 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. 



Remote Support 

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, there is 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).



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 you have connected to. Photon's 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 you've 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!



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 you're 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 you are dialling 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. Here is 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), you'll 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.