QNX4 Demo Disk: An Expounding Look

Submitted by noc on Wed, 03/24/2004 - 11:16

By Samuel Sidler , inspired by this forum post., with permission from Linas

Long ago, before QNX6 was the "thing" and the non-commercial version of QNX had yet to exist, there was a floppy. Not just any floppy though. The renouned QNX4 Demo Disk, running QNX 4.25, is considered the most functional one-floppy OS ever released. Two versions were created, a network and a modem version, both allowing the user to access the Internet while running the floppy.
Even with all it's fame and glory, however, the Disk was poorly documented and not exploited for some of the features that existed. Fast-fowarding to today, we're going to go in-depth into some of the features that were never accessed and ways to update the Demo Disk. This article is for anyone with a floppy disk and a desire to go memory lane.

Special thanks to Linas for posting the original version of this article and allowing us to edit/revise it. His article was originally found in OpenQNX forums.

To begin with, you will need the Disk. The network version is a better bet (assuming you're on a LAN with Internet) as most modems are now software modems as oppose to hardware ones.

You can download the disk from PlanetMirror who appears to have hosted the file since it's creation. Alternatively, Linas has provided a booting CD version of the disk for those that may not have any spare floppies anymore.

Next, you'll need to be sure you have a network connection. The major functionality of the Disk centers around this. The network-version of the Disk supports 3C509, NE1000 and NE2000 NIC protocols.

Also, for the purposes of this demonstration, we're going to optionalize the need for a local network with an HTTP, FTP, and Telnet server. These are not required, but will the article will assume you have them.

Section 1: Preperation

From first glance, the Disk looks very restictive, only allowing a few rights. QNX basically trapped you in the GUI, not that that's a bad thing. However, with this version of the Disk, there is an undocumented "back door."

Using the file browser, go to /usr/httpd/.photon/pwm/. Open pwm.menu. This is the file that controls menu options. The provided version of the OS gives you permissions to edit and save it.

Next, let's change the following line into some a little more useful. Change line 1 into line 2.

1. Towers of Hanoi G voyager -x0 -y0 -h412 -w628 -u http://127.1/hanoi/game.html

2. Voyager compact G voyager -x0 -y0 -h412 -w628 -c

The option "-c" specified at the end of the line launches voyager in "compact" mode, thus saving a bit of scarce system memory. Go ahead and save the file. If you open the menu now, you see that nothing is changed. Now we will refresh the pwm menu.

Step 2: Refreshing the PWM Menu

With the version 4.05 release, QSSL introduced the possibility to upgrade the system via extra applets. Only three special packages were released, however. You can download them here:

The upgrade option here is the backdoor we've been looking for. Everytime you install or deinstall a package, the PWM menu is refreshed. This allows you to change and refresh the PWM menu.

It's quite simple, actually. Change the pwm.menu file in /usr/httpd/.photon/pwm/pwm.menu, install, or deinstall an extension, and execute a command via an option in the PWM menu.

So, to test compact version of Voyager (without the fancy buttons), you need to follow the procedure above. NOTE: Before opening in "compact" mode you need keep open at least one Voyager window in "normal" mode. Other wise you'll get an error message that says "server not running".

Step 3: Getting the Shell

Trying to create a .qnxde applet is near impossible as there was no information released about the format and structure of the files. Really, there is no need to create our own .qnxde applets. A work around proves this true.

The QNX Demo installer works like this. First, it copies any file with a .qnxde extension from the external web server to a local /tmp_ram directory. The installer pops up a windows asking whether you want to "Continue" or "Cancel." Whichever you press, the installer detects that the file is either valid or invalid. If invalid, it erases the /tmp_ram directory. Of course, with original QNX extensions, this is not the case as they are valid.

With this in mind, use the following directions to load a shell.

  1. Add the following line to /usr/httpd/.photon/pwm/pwm.menu:

ksh_tmp pterm -z -R /dev/pty/ /tmp_ram/ksh.qnxde

(Important note: PWM menu lines are written like in this example:
ksh_tmp<TAB><SPACE_or_any_symbol><TAB>pterm -z -R
/dev/pty/ /tmp_ram/ksh.qnxde )

  • Download and install the telnet.qnxde extension.
  • Download ksh.qnxde from an external web server, but when installer window pops up DO NOT press anything. Leave the window open.
  • Next, open the PWM menu and execute the new line "ksh_tmp".
  • And there's your shell. Quite simple really, isn't it?

    Step 4: Installing the FTP Extension

    Now that we have the shell, which is quite useful, FTP is just another step away and is also quite useful

    1. Add in /usr/httpd/.photon/pwm/pwm.menu the following line:
      ftp_tmp pterm -z -R /dev/pty/ /tmp_ram/ftp.qnxde
    2. Download and install the telnet.qnxde extension. If it is already installed, you do not have reinstall it. We need the telnet.qnxde utility for using pterm terminal that comes with it.
    3. Modify the /etc/services file and add the following line:
      ftp 21/tcp
    4. Refresh PWM menu by downloading and installing the utils1.qnxde extension.
    5. Download ftp.qnxde from an external web server, but when the installer window pops up DO NOT press anything. Leave it running.
    6. Open the PWM menu and execute the new line "ftp_tmp".
    7. Test the ftp connection and have fun :)

    Step 5: Mounting a Floppy

    The QNX Demo is capable of running almost any QNX4 application. The simplest way to do this is by accessing floppy. To enable that support, follow the steps below.

    1. Add in /usr/httpd/.photon/pwm/pwm.menu the following lines:
      fsys pterm -z -R /dev/pty/ /tmp_ram/fsys.qnxde
      fsysfl pterm -z -R /dev/pty/ /tmp_ram/fsys.floppy.qnxde
      mount pterm -z -R /dev/pty/ /tmp_ram/mount.qnxde /dev/fd0 /fd
      pfm /fd/pfm
    2. Download fsys.qnxde from an external web server. When the installer window pops up, execute the "fsys" line from the PWM menu. Leave the terminal window open. Close the installer by pressing "Cancel".
    3. Download fsys.floppy.qnxde from an external web server. When the installer window pops up execute the "fsysfl" line from the PWM menu. Leave the terminal window open. Close the installer by pressing "Cancel".
    4. Insert a QNX4 formatted floppy disk. Again, download mount.qnxde from an external web server. When the installer window pops up execute the "mount" line from the PWM menu. Leave the terminal window open. Close the installer by pressing "Cancel". Now, via the File Browser you can see contents of the floppy in the folder /fd.

    The floppy is now accessible. Again, it should be QNX4 formatted. You can execute almost any QNX4 terminal and photon applications.

    Step 6: Other Useful Toys

    Take control over your file system in comfort and download the file manager. Follow the steps above, with the following line and the pfm.qnxde extension.

    pfm_tmp /tmp_ram/pfm.qnxde

    Need a clock for your computer? Want to turn your old 386 into a wall clock? Use the following line and the pwmclock.qnxde to do it.

    pfm_tmp /tmp_ram/pwmclock.qnxde

    Tips and Tricks

    At the end of all these experiments you might be using the following PWM menu:

    =CUSTOM QNX Workspace Menu
    Join the Internet J netcfg
    Voyager Web Browser V voyager -x0 -y0 -h412 -w628
    Towers of Hanoi G voyager -x0 -y0 -h412 -w628 -u http://127.1/hanoi/game.html
    File Browser F fbrowse
    Notepad N note
    Install voyager -u http://your_http_server_ip/
    Install telnet voyager -u http:// your_http_server_ip /telnet.qnxde
    Remove Extensions destaller
    fsys /tmp_ram/fsys.qnxde
    fsysfl pterm -z -R /dev/pty/ /tmp_ram/fsys.floppy.qnxde
    mount pterm -z -R /dev/pty/ /tmp_ram/mount.qnxde /dev/fd0 /fd
    ftp_tmp pterm -z -R /dev/pty/ /tmp_ram/ftp.qnxde
    ksh_tmp pterm -z -R /dev/pty/ /tmp_ram/ksh.qnxde
    ftp pterm -z -R /dev/pty/ /fd/ftp
    ksh pterm -z -R /dev/pty/ /fd/ksh
    pfm /fd/pfm
    umount /fd/umount /dev/fd0
    Shutdown S reboot

    To make it easier, you could copy this entire section and paste it into your PWM menu in one great effort. Unfortunately, however, it is not possible copy text from a Voyager window directly. But of course, there is workaround:

    1. Place this list as text file on your telnet server.
    2. Connect with QNX Demo (as described above).
    3. Open it in terminal window and cut/copy it with the shortcut: Ctrl-Alt-X
    4. Paste in the note editor Ctrl-V

    Another tip to note, is that you can press the "Cancel" button as soon as your program is on the screen. This enables you to install/run the next one.

    There were some hardware issues with the Demo. Some types of keyboards refuse to work under Photon. Although they respond perfectly normal during the startup phase, they "freeze" when GUI is started. To get around this, press F1 to go to the diagnostic screen. When GUI appears press a lot. Generally 20-40 hits are enough to "wake up" the keyboard up and make it work in the QNX Demo.

    Final Notes

    All the material described is for educational purposes only. This article is merely to show the possibilities of the QNX Demo disk. There are probably many more. All the files described in this article were downloaded from free and publicly available ftp servers.

    The original article by Linas was located at http://qnx.projektas.lt/qnxdemo/qnx_demo_disk.htm.
    The original article by Sam was located at http://qnxsite.com/node/view/44.