Installing XFree86 for OS/2

XFree86 is a freely available implementation of XWindows for OS/2 (and other operating systems). If you're not sure what XWindows does or whether you need it, OS/2 e-Zine has a good overview. This document focuses solely on how to install it, and only one of the many possible ways of installing it.

1. Background & Preparation

In order to follow these instructions you need to download the installation script Doug created: INSTXF.ZIP. This script supports XWindows with TVFS. TVFS is the Toronto Virtual File System, a piece of Employee Written Software from IBM Toronto. It lets you create symbolic links into a directory, for example you could map your C: drive as a subdirectory "cdrive" into D:, and "dir D:\cdrive" would show the contents of you C: drive. Strictly speaking it isn't needed for XWindows, but many X applications come from the Unix world & don't understand drive letters, so you will probably need it soon anyway.

2. Creating Subdirectories, Installing TVFS

2.1 Creating Subdirectories

There needs to be a place to put the files for XFree86 and its applications, and they don't have to be anywhere but on one of your hard disks. Since we will be using the TVFS to create a virtual drive you can tuck this directory into any corner of your hard disk your heart desires; however, XWindows is from the Unix world & assumes long file names, so the hard drive must be formatted with HPFS. Create a directory now to hold the files; for purposes of this document we will assume it is C:\XWindows.

As part of the install the following subdirectories will be created in your directory:

C:\XWindows\     [the directory you create]
           \emx
           \xfree86
           \home
           \tmp
           \tvfs
           \scripts
2.2 Preparing the Script

Extract INSTXF.ZIP into C:\XWindows. You should see these files:

instXfree86os2.cmd - the installation script
XfEnvSetup.cmd - will be modified to suit your system, then run before starting XWindows
tvfs.ifs - The TVFS file system driver. Extracted from tvfs211.exe
xf86sup.sys - the XFree86 support driver. Extracted from Xbase.zip

2.3 Installing the Drivers

Add the following lines to your config.sys file:
IFS=C:\XWindows\tvifs.sys
DEVICE=C:\XWindows\xf86sup.sys
Reboot your PC. You should see a message from xf86sup.sys when OS/2 starts up.

3. Downloading & Installing XFree86

3.1 Downloading the Files

Download the following files to a temporary directory, something other than C:\XWindows.

ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/Xbase.zip
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/Xbin.zip
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/Xdoc.zip
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/Xfnts.zip
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/Xfscl.zip
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/Xman.zip
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/emxrt.zip
ftp://ftp.leo.org/pub/comp/os/os2/leo/drivers/ifs/tvfs211.zip (TVFS)

3.2 Modifying the Install File

The instXfree86os2.cmd file is a command file that will extract the XFree86 files & automatically do some of the setup work. It will: You're probably wondering "how will instXfree86os2.cmd know which of my drive letters are hard drives?" Well, it won't. You have to open the file in an editor first & modify. As shipped it will create links for C:, D:, & E:. You need to modify that section, adding or subtracting letters as needed.

3.3 Running the Install File

instXfree86 takes 4 parameters, as shown:
instXfree86 arg1=(path to XFree86 zipfiles) arg2=(path to REAL install dir)
            arg3=(VIRTUAL drive letter, no colon) arg3=(Boot drive letter, no colon)
for example,
instXfree86 d:\temp C:\XWindows X C
There is no input checking, so be sure all parameters are present & correct. Note the location of outfile.tmp displayed when instXfree86 is just about done.

4. Installing Your XFree86 Video Driver

4.1 Determining Which Driver

XFree86 doesn't use the OS/2 video driver; instead, it uses its own, much like a full-screen Windows 3.1 session. Open outfile.tmp (created by Superprobe), to see how it identified your video card & chipset.

Now that you know what kind of chipset your video card has, you need to download it. Full featured XDrivers have the following naming convention: the name start with X followed by the board manufacturer or chip name. If you don't see it, look through README.OS2 in the base XFree86 directory on your VIRTUAL drive. If you still don't see it use XSVGA.zip from: ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/OS2/
XSVGA actually contains accelerated drivers for many different cards, including most Matrox cards.

4.2 Preparing the Driver

Unzip the driver file in the root directory of your virtual drive, which in our case is X:. Be sure to preserve paths when unzipping.

Open your XfEnvSetup.cmd in a text editor & change the line "set XSERVER=" to match the name of your video driver. The name should follow the pattern XF86_(manufacturer/chip name).EXE, or it may be XSVGA.EXE.

5. Configuring Everything

5.1 Establishing Video Modes for Your Monitor

In this phase you will create a list of video modes XWindows is allowed to run in, which must be safe for your monitor. Start by getting out the manual for your monitor & looking up the limits for resolution, vertical scan frequency, and horizontal refresh rate (frequency). It is possible to damage a monitor by exceeding its limits, particularly if is an inexpensive or older monitor. If you can't find the specs for your monitor, stick with 640x480, 60Hz for vertical, and 31.5kHz for horizontal.

Start a full-screen OS/2 session. Run XfEnvSetup.cmd with one parameter, the drive letter of your virtual drive - for example, "XfEnvSetup X". Then run XF86Config. It will ask you many questions about your monitor & keyboard, then build a configuration file to suit. You can run it again later, or edit the file by hand if you wish.

XF86Config assumes you know what you're doing. It won't limit you, but it will give you enough rope to hang yourself (actually, almost everything about XWindows is like that). Read the instructions carefully, & when in doubt, accept its suggestions. Here are some sample answers to its questions:

Do you want to use XKB = yes
Keymap = 1, or choose your keyboard if you see it
Horizontal sync rate = from your monitor specs, or choose 1 (31.5kHz)
Vertical refresh rate = from your monitor specs, or choose 1 (60Hz)
Monitor ID = whatever you choose, such as "Steve's monitor"
Manufacturer = from your monitor specs
Model = from your monitor specs
Do you want to look at the card database = yes
[page through the list of cards until you find yours, then jot down the value in the right-hand column & enter the number]
[note if clocks should be probed or a clock line used - normally no to both]
Default server = 5
VideoRam = from your card specs; 6 lets you enter a value directly
Card ID = whatever you choose, such as "Steve's video card"
Vendor = from your card specs
Model = from your card specs
Clock Chip = hit <Enter> for none, unless your card is on the list
Run X-probeonly = no, unless the card database said to probe clocks
Change modes = 5
Write = yes (no will let you write to a different directory, or not at all)

5.2 Setting the window manager

In X a window manager controls the look of the outside of the windows, such as the title bars, and it can be changed. There is much more to the subject than there is space for here; what matters is that 1) the default window manager is both ugly & confusing for an OS/2 user, and 2) it can easily be changed to a much better one that already comes with XFree86.

Use a text editor to open C:\XWindows\xfree86\lib\X11\xinit\xinitrc.cmd. Find the line near the bottom that says 'twm', comment it out, and type in 'icewm'. It should look like this:

 /* 'twm' */
 'icewm'

5.3 Starting XFree86

Congratulations! You are finally ready to start up XFree86! Open an OS/2 window (most enhanced shells won't work), go to C:\XWindows, and run "XfEnvSetup X". When that compeletes, run startx. Within 30 seconds you should see your XWindows desktop.

Last updated on 4/10/99.