Virtual OS/2 International Consumer Education
VOICE Home Page: http://www.os2voice.org
April 2003

[Newsletter Index]
[Previous Page] [Next Page]
[Feature Index]

editor@os2voice.org


Installing XFree86/OS2 4.3.0

By Christian Hennecke© April 2003

XFree86/OS2 4.x is available for download from Netlabs. The binary distribution consists of a number of ZIP files which are containing programs, servers, fonts, libraries, include files, man documentation pages and configuration files. The complete distribution requires 55MB space on your harddisk.

1. Choosing the software

The XFree86/OS2 distribution only includes the "core" and no applications and consists of the following packages with their approximate size in brackets:

Required packages

In comparison to XFree86/OS2 3.3.x, there are no extra X server packages.

Optional packages:

In order to save space on your disk and reduce net bandwidth, choose the software to obtain carefully.

2. Pre-checking the compatibility of the video hardware

Of course it would be best, if you found out whether your particular video adapter is supported by XFree86/OS2 or not prior to downloading all the software. Information on supported chip sets is available at the Driver Status for XFree86 page. This information is also available in several files in the \XFree86\lib\X11\doc\html directory of the distribution, which can be found in the X11.zip archive.

In all cases, please take some time to carefully check the accompanying README.* file in the Y:\XFree86\lib\X11\doc directory for special precautions, options, or features of the card.

3. Unpacking the archives

In the following we assume that you install XFree86/OS2 on drive Y: in the directory Y:\XFree86. Please adapt the commands and file entries according to your real choice. While naming the directory XFree86 and placing it in the root of the drive was not necessary per se, but strongly recommended for previous version of XFree86/OS2, it is mandatory now! If you don't follow this standard, it may not work! Let's also assume that the XFree86/OS2 distribution's archives reside in a directory X:\temp.

CAUTION: The drive you install XFree86/OS2 to must support long filenames! If you want to use TVFS, do not install XFree86/OS2 4.x onto such a drive, but to the real drive instead, and use TVFS later when all configuration tasks have been finished.

  1. Ensure that drive Y: supports long filenames and has sufficient free space (roughly 90 MB for the complete distribution).
  2. Open an OS/2 command line, switch to the root of drive Y:, and unpack all archives which are located in X:\xtemp by issueing the command:
    unzip X:\xtemp\*.zip
  3. During the unpacking process UNZIP may report that some files already exist. Don't worry and let UNZIP replace the files. (This is required for the bug-fixed version of xf86cfg.exe in xf86cfg.zip to replace the defective one in Bin.zip.) By entering A (in uppercase!) all subsequent files will be overwritten if they already exist without asking again.
  4. No special sequence is required for unpacking the archives.

4. Changing CONFIG.SYS

XFree86/OS2 requires a number of settings in CONFIG.SYS to work correctly. Please add the following changes to your CONFIG.SYS and in particular take care writing paths with slash "/" and backslash "\". You can transfer the settings with cut & paste and then adapt them to your system.

Be sure to double-check that everything has been entered correctly. The X server itself will do some checking and will refuse to start, if something is wrong.

5. Network configuration

It is beyond the scope of this document to even give an introduction to the correct installation of the TCP/IP networking system. You must do this yourself or seek assistance elsewhere. It is only possible to say here that a PC which is working well in a TCP/IP based LAN network will also work with XFree86/OS2 (when all other prerequisites are matched as well). You may want to check OS/2 internet publications like OS/2 eZine, the VOICE Newsletter, or Walter Metcalf's archive of Focus on OS/2 articles.

In any case, you should configure and activate the so-called loopback interface, which can be used for contacting the same machine via network internally. Dependent on the version of OS/2 this can be done differently. Otherwise you will have to establish a network/internet connection and have to fight problems with dynamic IPs.

  1. Create a hosts file in the directory which the ETC variable points to. Add the line
    127.0.0.1  localhost
    

    to the file. This line must end with RETURN/<ENTER>.

  2. If you don't have a correctly installed networking card, add
    SET HOSTNAME=localhost
    

    to CONFIG.SYS. Take care of the connection to the DISPLAY variable.

  3. Add the following line to your CONFIG.SYS:
    SET USE_HOSTS_FIRST=1
    

    That way the file hosts is searched first upon resolving domain names instead of immediately connecting to a domain name server.

  4. Activate the interface. Depending on which version of OS/2 you use, this has to be done differently:

    If you use Warp 3 and the IAK, add the following line to the file \tcpip\bin\tcpstart.cmd:

    ifconfig lo 127.0.0.1 up
    

    On Warp 3 Connect and Warp 4 machines the file is called \MPTN\BIN\MPTSTART.CMD. If such a file does not exist, create one and add the line

    CALL=C:\OS2\CMD.EXE /Q /C C:\tcpip\bin\tcp-start.cmd >NUL:
    

    (or MPTSTART.CMD, respectively) to your CONFIG.SYS.

    Using Warp 4 or later you can also activate the interface more conveniently by opening the TCP/IP Configuration (LAN) object, selecting the notebook page Network, selecting loopback interface for configuration and ticking the configuration option Activate interface. The entry field IP Address must contain the 127.0.0.1 address.

  5. Reboot. Now check the new configuration. Open an OS/2 command line and enter the following command:
    ping localhost
    

    If all is correct, the values for "time" should be 0 seconds each. Terminate the program after some time by pressing <CTRL-C>. A packet loss of 0% should be displayed.

6. Configuring X for your hardware

Now XFree86/OS2 has to be adapted for your hardware, i.e. the video adapter, the monitor and the keyboard. For this the horizontal sync rates and vertical refresh rates of your monitor and data about your keyboard (number of keys, country version) are required. If your monitor supports DDC, as will be most probably the case with modern monitors, XFree86/OS2 will be able to detect its capabilities automatically. Otherwise you will need to get the values from your monitor's manual.

Configuration can be done in a number of different ways. In the following the most convenient is described.

  1. First you need to create an initial configuration file and see if the X server detects your hardware. Open an OS/2 window, switch to the drive where XFree86/OS2 is installed, and issue the following command:
    xfree86 -configure
    

    The screen will go black, some text will scroll by and then the desktop should reappear after a short time. If it does not do so, press <CTRL-ALT-BACKSPACE> to kill the X server. If that still does not work, you will have to reboot the machine by pressing <CTRL-ALT-DELETE> and ask for help.

  2. Take a look at the file Y:\usr\adm\XFree86.0.log. If your CONFIG.SYS and network settings are correct, you will see that the server loaded a large number of modules to detect your hardware. Otherwise it should complain about certain variables not being set and the like. Scroll to the bottom of the file. You should see some messages from the driver for your chip. A typical output for a Matrox G400 card would look like this:
    (II) MGA(0): VESA BIOS detected
    (II) MGA(0): VESA VBE Version 3.0
    (II) MGA(0): VESA VBE Total Mem: 16384 kB
    (II) MGA(0): VESA VBE OEM: Matrox Graphics Inc.
    (II) MGA(0): VESA VBE OEM Software Rev: 2.1
    (II) MGA(0): VESA VBE OEM Vendor: Matrox
    (II) MGA(0): VESA VBE OEM Product: Matrox G400
    (II) MGA(0): VESA VBE OEM Product Rev: 00
    

    If your monitor supports DDC, you should also see something like the following:

    (II) Loading sub module "ddc"
    (II) LoadModule: "ddc"
    (II) Loading j:/XFree86/lib/modules/libddc.a
    (II) Module ddc: vendor="The XFree86 Project - XFree86/OS2"
    compiled for 4.3.0, module version = 1.0.0
    ABI class: XFree86 Video Driver, version 0.6
    (II) MGA(0): VESA VBE DDC supported
    (II) MGA(0): VESA VBE DDC Level 2
    (II) MGA(0): VESA VBE DDC transfer in appr. 1 sec.
    (II) MGA(0): VESA VBE DDC read successfully
    

    If DDC is not reported to be supported, you will need to provide the information about your monitor's capabilities yourself (get them from your monitor's manual).

    Last, you should see a message that a new configuration file called XF86Config.new has been written to your HOME directory.

  3. If the log file shows no errors and the detected hardware matches your real one, copy the file XF86Config.new from your HOME directory to Y:\XFree86\lib\X11.

Now we need to use XFree86's new configuration program. It offers both a GUI and a plain menu-driven textmode interface, each of which have their advantages. While the GUI provides more options and flexibility, the textmode version has less "distractions" and does not require the X server to be running. Note however, that the textmode version requires the ncurses library to be installed correctly. So if you aren't sure that the X server has detected your hardware correctly, you may want to use the textmode version and continue with chapter 6.2.

6.1 Using the graphical interface

In the following, the behaviour of GUI elements is different from standard OS/2. To invoke any pop-up menus and select items from them or menu bars, you need to click and hold the mouse button!

  1. It is time to start the X server. Open a command line, switch to the XFree86/OS2 drive, and start the X server by issueing the following command:
    startx
    

    The screen should go black with some text displayed for a short time. Then the system should switch to graphics mode and you should see a black "X" cursor on a grey pattern background. Some seconds later, you should notice some hard disk activity and two windows should appear, one with a command line prompt on the top left and a clock on the top right.

    WARNING: If this does not happen and you see a distorted display or your monitor starts making strange noises, press <CTRL-ALT-BACKSPACE> to kill the X server immediately! Otherwise your hardware may get damaged.

    Note: Depending on the detected hardware's capabilities, the X server might start at an enormously high, interlaced resolution. While this is not good for your eyes, it shouldn't pose any problems for your hardware.

  2. Click on the command line window and start the graphical configuration program:
    xf86cfg
    

    Then the outline of the configuration programs window will be displayed for you to determine where to display the full window. Place it anywhere you can view the complete content. The command line window will display a large number of messages about modules being loaded. Unless the program crashes completely, it is safe to ignore any error messages about not loadable modules.

    xf86cfg main window

  3. XFree86/OS2 always uses the OS/2 mouse driver, so there is no reason to change the mouse settings. Actually, changing them to anything else than OS2Mouse is likely to cause problems.
  4. Right-click on the keyboard icon in the layout display and choose the configure item from the pop-up menu. In the keyboard configuration dialog, select your keyboard from the keyboard model drop-down list. Most people, who own a keyboard with Windows keys, may want to select one of the Generic 104-key PC or Generic 105-key (Intl) PC models. Then select your language-specific layout from the keyboard layout drop-down list. Note that this only specifies the keyboard's layout, not any internationalization support. Confirm the changes and leave the dialog by pressing Ok.

    xf86cfg keyboard dialog

  5. If your monitor does not support DDC, right-click on the monitor icon and select configure. This will bring up the monitor configuration dialog. There you need to specify horizontal and vertical refresh rates. You can do this by either clicking on one of the predefined values (clicking on the descriptive entries in the list for horizontal refresh rates will result in the accompanying rate range being displayed in the entry field above), or by manually specifying ranges in the respective entry fields.

    WARNING: Wrong values can result in damaging your monitor! If you are in doubt about your monitor's capabilities, it is safer to select lower rates.
    CAUTION: When specifying decimal values, always use a dot as separator, no comma!

    xf86cfg monitor dialog

    Example: An old SONY Multiscan 15sf is not capable of DDC and has a horizontal refresh rate range of 31.5 - 64 kHz. The list entry Monitor that can do 1280x1024 @ 60Hz equals a range of 31.5 - 64.3 kHz. Being the cautious type we don't select that entry, but define my our range by entering the according values in the entry field. The SONY's range for vertical refresh rates is 50 - 100 Hz, so it's safe to select the 50 - 100 item.

    Confirm the changes and leave the dialog by pressing OK.

  6. If the X server didn't detect the hardware correctly, or you want to change the video adapter definition for some reason, right-click on the video adapter symbol and select configure. The configuration dialog will present you with a large scrollable list of chips. If you only want to choose from the models of a certain vendor, type in the chip name in the Card model filter entry field and press <ENTER>. Note that you will have to specify the chip's ID, not the vendor name. Matrox won't work, for instance, but mga does. After you have selected a card model from the list, the dialog automatically selects the appropriate driver from the Driver drop-down list. You can also select the driver directly yourself, of course. Confirm the changes and leave the dialog by pressing OK.

    xf86cfg card dialog

    Example: For a Matrox G400 Double Head with 16 MB of video RAM, scroll down to and select mga mgag400. The rest should be detected automatically on startup.

    Depending on the video chip in your hardware, the XFree86 drivers often offer a number of special options to enable or configure support for advanced features. Normally, you don't need to change any of these options.
    To set these options, right-click on the video adapter symbol and select options. A dialog will show up which allows you to select from the options which are available for the current driver. For details about the available options, see the HTML files in Y:\XFree86\lib\X11\doc\html. These files follow the <driver_name>.4.html naming scheme.

  7. Next, we need to specify some screen resolutions and color depths for XFree86/OS2 to run at which don't hurt our eyes. Click on the Configure layout item in the menu bar and select Configure screen. (To get back to the main menu, select Configure screen in the menu bar and select Configure layout.)

    xf86cfg main screen dialog

    Right-click on the monitor symbol and select configure. The default color depth of 8 bit resembles 256 colors, which is too few for most of today's applications. Choose 16 bit for 65536 colors or 24 bit for 16.7 million colors. If required, you can still start the X server at a different color depth via a command line option later. The left pane below shows the scrollable list of available resolutions, while the right pane shows the selected ones. With the arrow buttons in the middle you can add resolutions to or remove resolutions from the right and move them up or down in the right list.

    xf86cfg screen dialog

    The list of resolutions on the right defines the resolutions which the X server will be able to use at a given color depth. The topmost resolution will be the default resolution which the X server uses upon startup. If later while running XFree86/OS2 you should feel the need to use another of the other resolutions in the list, e.g. to play a game which requires a resolution of 640x480, or to work with some graphical application which consumes a lot of screen real estate, press the key combination <CTRL-ALT-+> or <CTRL-ALT--> (+/- from the numeric key block only) to cycle through the list of defined resolutions.

    CAUTION: Note that xf86cfg creates the necessary entries in XF86Config for the default color depth only! If you start the X server at another color depth, don't be surprised, if it used another resolution. To workaround this problem, make a color depth which you want to setup resolutions for the default, setup the resolutions, and close the dialog by pressing Ok. Then re-open the dialog and repeat the same for the next color depth. When you have configured all color depths, open the dialog a last time, mark the default color depth, and close the dialog again by pressing Ok.

    Example: For a 19" monitor a good choice would be to use 1280x1024 as default resolution (at the top of the right list). If you like to play a game now and then and the game is not able to use more than 640x480 pixels, add 640x480. Then you can switch to 640x480 by pressing <CTRL-ALT-+> whilst running at 1280x1024.

    Confirm the changes and leave the dialog by pressing OK.

  8. To leave the configuration program, select Quit. In the confirmation dialog, you can finally choose whether to save the changes or not and to which file. If everything is OK, select Yes to save the main configuration file XF86Config. Otherwise select No to quit without saving or Cancel to continue with configuration.

    xf86cfg confirmation dialog XF86Config

    If you press Yes, another confirmation for the keyboard settings file with the same choices will appear. Press OK to save settings and quit the program.

    xf86cfg confirmation dialog xkb

  9. To enable the changes, you need to terminate and restart XFree86/OS2 now. Close the command line window by entering
    exit
    

    Finally, quit the window manager session (and thereby XFree86/OS2) by right-clicking on the desktop background and selecting Exit.

Please continue with chapter 7.

6.2 Using the textmode interface

While the textmode interfaces offers graphical menus, it does not support the mouse. Navigation is done with the arrow keys, checkboxes are selected by pressing the space bar, and control elements which have the focus (colored blue) are activated by pressing <ENTER>.

  1. Open an OS/2 command line and switch to the drive where XFree86/OS2 is installed. Then start the configuration program by entering:
    xf86cfg -textmode
    

    You will see a lot of messages regarding the loading of modules scroll by. Unless any severe error occurs, you should see the following welcome message:

    xf86cfg welcome message

  2. XFree86/OS2 always uses the OS/2 mouse driver, so there is no reason to change the mouse settings. Actually, changing them to anything else than OS2MOUSE is likely to cause problems.
  3. Select the Configure keyboard menu item by pressing the down-arrow key and press <ENTER> to confirm your selection. This will invoke the Keyboard configuration menu:

    xf86cfg keyboard configuration menu

    Select Edit Keyboard0 and press <ENTER> to edit the keyboard definition. The Keyboard model dialog lets you select your type of keyboard. Note that the list of available models is very long. Scroll with the up and down arrow keys to see which menu item suits your keyboard best.

    xf86cfg keyboard model dialog

    Most people who own a modern standard keyboard with Windows keys will want to select one of the Generic 104-key PC or Generic 105-key (Intl) PC models. Select your preferred item and press <ENTER>.

    Then select your language-specific layout from the Keyboard layout list. Note that this only specifies the keyboard's layout, not any internationalisation support.

    xf86cfg keyboard layout dialog

    Confirm your selection and finish keyboard configuration by pressing <ENTER>.

  4. If your monitor does not support DDC, select the Configure monitor item and press <ENTER>. This will bring up the Monitor configuration dialog:

    xf86cfg monitor configuration menu

    To configure your monitor, select Edit Monitor0 and press <ENTER>. This brings up the Monitor HorizSync dialog, where you need to specify the range of horizontal sync rates which your monitor is capable of. You can do this by either selecting one of the predefined values (the values of the beginning of each line specify the rate, rates, or range of rates), or by selecting Enter your own horizontal sync range to manually specify the range.

    xf86cfg monitor's horizontal sync rate

    Next we need to specify the vertical refresh rates in the Monitor VertRefresh dialog. You can do this by either selecting one of the predefined ranges, or by selecting Enter your own vertical sync range to manually specify the range.

    xf86cfg monitor's vertical refresh rate

    WARNING: In both cases, wrong values can result in damaging your monitor! If you are in doubt about your monitor's capabilities, it is safer to select lower rates.
    CAUTION: When specifying decimal values, always use a dot for separation, no comma!

    Example: An old SONY Multiscan 15sf is not capable of DDC and has a horizontal refresh rate range of 31.5 - 64 kHz. The list entry Monitor that can do 1280x1024 @ 60Hz equals a range of 31.5 - 64.3 kHz. Being the cautious type we don't select that entry, but define our own range by selecting Enter your own horizontal sync range and entering the according values in the entry field and pressing <ENTER>:

    xf86cfg monitor's horizontal sync rate, manual definition

    The SONY's range for vertical refresh rates is 50 - 100 Hz, so it's safe to select the 50 - 100 item and finish with <ENTER>.

  5. If the X server didn't detect the hardware correctly, or you want to change the video adapter definition for some reason, select Configure card and press <ENTER>. This brings up the Card configuration dialog which asks whether you want to select your card from a large database of video card definitions:

    xf86cfg card configuration start

    The database of video card definitions provides a convenient way to choose the appropriate drivers. So unless you have some very new or exotic stuff, select Yes with the arrow keys and press <ENTER>.

    The Card database dialog presents you with a large scrollable list of video chip sets. Note that chip IDs are listed only, not the vendor name. Looking for Matrox won't work, for instance, but mga does. You can also jump to the first chip name that begins with a certain character by pressing the according key.

    xf86cfg card database

    Example: For a Matrox G400 Double Head with 16 MB of video RAM, scroll down to and select mga mgag400. The rest should be detected automatically on startup.

    When you select a card, the dialog will automatically select a suitable driver in the following Card driver dialog:

    xf86cfg card driver

    If you think that xf86cfg did not select the correct driver, you can still change it by selecting from the scrollable list. The vga driver should always work, but it is very slow and only works at a resolution of 320x200.

    Finally, you need to specify the card bus ID. Do not change this field unless you have more than one video card and simply finish by pressing <ENTER>.

    xf86cfg card bus ID

  6. Next, we need to specify some screen resolutions and color depths for XFree86 to run at which don't hurt our eyes. Select Configure screen to bring up the Screen configuration dialog:

    xf86cfg screen menu

    Select Edit Screen0 and press <ENTER> to bring up the Screen depth dialog. There you can specify which color depth you want XFree86/OS2 to use by default. The default color depth of 8 bits resembles 256 colors, which is too few for most of today's applications. Choose 16 bits for 65536 colors or 24 bits for 16.7 million colors. If required, you can still start the X server at a different color depth via a command line option later.

    xf86cfg screen depth

    The list of resolutions in the Screen modes dialog defines the resolutions which the X server will be able to use at a given color depth. Select all resolutions you want to use by highlighting them and pressing the space bar. The highest selected resolution will be the default resolution which the X server uses upon startup. If later while running XFree86/OS2 you should feel the need to use another of the other resolutions in the list, e.g. to play a game which requires a resolution of 640x480, or to work with some graphical application which consumes a lot of screen real estate, press the key combination <CTRL-ALT-+> or <CTRL-ALT--> (+/- from the numeric key block only) to cycle through the list of defined resolutions. Finish your selection by pressing <ENTER>.

    xf86cfg screen modes

    CAUTION: Note that xf86cfg creates the necessary entries in XF86Config for the default color depth only! If you start the X server at another color depth, don't be surprised, if it used another resolution. To workaround this problem, make a color depth which you want to setup resolutions for the default, setup the resolutions, and finish. Then re-open the dialog and repeat the same for the next color depth. When you have configured all color depths, open the dialog a last time, mark the default color depth, and finish setup again.

    Example: For a 19" monitor a good choice would be to use 1280x1024 as default resolution. If you like to play a game now and then and the game is not able to use more than 640x480 pixels, add 640x480. Then you can switch to 640x480 by pressing <CTRL-ALT-+> whilst running at 1280x1024.

  7. To leave the configuration program, select Write XF86Config and quit. In the confirmation dialog, you can finally choose whether to save the changes or not and to which file:

    xf86cfg save confirmation dialog

    If everything is OK, select OK to save the main configuration file XF86Config. Otherwise select Cancel to return to the main menu.

7. Starting the X server

Now you can start XFree86/OS2 from a command line via:

startx

If you prefer another color depth than the default, enter the following for e.g. 16 bit:

startx -- -depth 16

It is recommended to create a program object for XFree86/OS2 on your desktop. Enter the following for Path and filename:

Y:\XFree86\bin\startx.cmd

And for Parameters:

-- -depth <color_depth> 2>Y:\xerror.log

with <color depth> being the bit value for the preferred color depth. The parameter 2>Y:\xerror.log redirects the error output of the X server to the file Y:\xerror.log, so you can get some hints on problems, just in case.

8. Changing the Window Manager

By default XFree86/OS2 uses twm as Window Manager. Since especially twm offers only very basic features, you'll probably soon consider using another Window Manager. To activate your new alternative, copy the file XINITRC.CMD which normally resides in Y:\XFree86\lib\X11\xinit to your HOME directory, open it in an editor and replace the line 'twm' by 'your_window_manager_executable', e.g. 'enlightenment'. The single quotes are not optional! XFree86/OS2 will find the changed file upon startup and use it instead of the original one in Y:\XFree86\lib\X11\xinit.


Parts of this text have been taken from the README.OS2 file contained in the XFree86/OS2 3.3.x distribution, © Holger Veit.

References:
XFree86/OS2 4.3.0
Developer: Frank Giessler, Holger Veit (OS/2 port)
Price: Freeware

Software

XFree86/OS2 4.3.0 distribution: ftp://ftp.netlabs.org/pub/xfree86
EMX run-time: http://hobbes.nmsu.edu/pub/os2/dev/emx/v0.9d/emxrt.zip
ncurses library: http://hobbes.nmsu.edu/cgi-bin/h-search?key=ncurses&pushbutton=Search
Ported software: http://os2ports.com

XFree86/OS2-related sites

XFree86.org web site (documentation, source code): http://www.xfree86.org
Holger Veit's XFree86/OS2 home page (FAQ): http://ais.gmd.de/~veit/os2/xf86os2.html
XFree86/OS2 mailing list: http://borneo.gmd.de/mailman/listinfo/xfreeos2
The OS/2 Files (information and tips): http://www.os2world.com/os2files/index_d.html

Information about networking

OS/2 eZine: http://www.os2ezine.com
Focus on OS/2 archive: http://members.rogers.com/wfmetcalf/OS2_Treasury/Articles/


[Feature Index]
editor@os2voice.org
[Previous Page] [Newsletter Index] [Next Page]
VOICE Home Page: http://www.os2voice.org