# README for X11R&relvers; on LynxOS

## What and Where is X11R&relvers;?

X11R&relvers; is a port of X11R6.4 that supports several versions of Intel-based Unix. It is derived from XFree86 4.4 rc2 which was derived from X386 1.2, which was the X server distributed with X11R5. This release consists of many new features and performance improvements as well as many bug fixes.

See the Copyright Notice.

Building of this X11R&relvers; version has been tested on `LynxOS 3.1.0a i386' and `LynxOS 4.0.0 i386'.

Previous releases of X11R&relvers; supported LynxOS on the x86 and on the PowerPC platform. Building on PowerPC platforms has not been tested recently.

## Installing X11R&relvers;

Please refer to the Installation Document for detailed installation instructions.

It may be necessary to increase the process stack limit in order to build X11R&relvers; and run X11R&relvers; on your system. Edit `/etc/startab` and reboot your system to make the changes active before you begin the installation.

Also, be sure to include `/usr/X11R6/bin` in your PATH environment variable.

Refer to the next section running for further information on necessary configuration steps before running X11R&relvers; on LynxOS.

### Accessing X11R&relvers; manual pages

Include `/usr/X11R6/man` in the MANPATH environment variable or add the directory `/usr/X11R6/man` to `/usr/Lib/man.config`

## Running X11R&relvers;

This section describes the changes to the LynxOS environment which may be necessary to successfully run X11R&relvers;.

### System tuning

#### Tunable parameters

To reasonably run X11R&relvers; you may have to adjust a few system parameters.

On LynxOS 3.1.0 and 4.0.0 include a line

    #define X_WINDOWS

in `/sys/lynx.os/uparam.h`.

#### Adjustment for "nv" driver for NVidia graphics cards

If you're using the "nv" driver (Riva 128, nVidia TNT, TNT2, GeForce) on LynxOS `3.1.0', you will have to increase the value of the SMEMS parameter in `/sys/lynx.os/uparam.h` from 10 to 20.

#### Increase number of ptys

You should also increase the number of ptys to be able run a couple more xterms. You may replace `/sys/cfg/pty.cfg` with `/usr/X11R6/lib/X11/etc/pty.cfg`.

#### MTRR device driver

If you're using an Intel PentiumPRO or Pentium II (or higher) class CPU you might want to install the MTRR device driver. This driver enables the X11R&relvers; X server to manipulate the CPU memory type range registers which may improve performance on certain systems.

To install the driver follow these steps:

      # cd /
      # bash /usr/X11R6/lib/X11/etc/MTRR-Lynx.shar
      # cd sys/drivers/mtrr
      # make install

Then add a line

      I:../drivers/mtrr/mtrr.cfg

to `/sys/lynx.os/CONFIG.TBL` and rebuild the kernel (see next section).

#### Kernel build

If you plan to use a PS/2 mouse to the following sections before rebuilding the kernel, if not, you should rebuild the kernel now:

         # cd /sys/lynx.os
         # make install
         # reboot -N

### Mouse support in X11R&relvers;

X11R&relvers; includes support for PnP mice (see also Mouse Support in X11R&relvers;). The current LynxOS TTY device driver doesn't allow the necessary manipulation of the RTS line and therefore the support for PnP mice has been disabled for LynxOS.

### PS/2 mouse drivers

LynxOS x86 comes with a PS/2 mouse driver. If it is not currently installed on your system, install it with `/usr/bin/Install.ps2mouse`.

The LynxOS PS/2 mouse driver is not always able to properly handle the mouse initialization performed by the X server. If your mouse is not responding after the X server has started up, modify the PS/2 mouse driver as follows:

      --- /sys/drivers/ps2mouse/mousedrvr.c.orig      Wed Aug 25 09:51:02 2004
      +++ /sys/drivers/ps2mouse/mousedrvr.c   Wed Aug 25 09:50:54 2004
      @@ -261,6 +261,7 @@
       int mousewrite(struct statics *s, struct file *f, char *buff, int count)
       {
              int i;
      +       return 0;
       #ifdef DEBUG
              kkprintf("Mouse: write %d %x\n", count, buff[0] & 0x0FF);
       #endif

Then rebuild both the mouse driver and the kernel:

         # cd /sys/drivers/ps2mouse
         # make
         # cd /sys/lynx.os
         # make install
         # reboot

### ATC console driver and VT switching

Currently there is no support for virtual terminal switching once the server has started. Support for this feature may be added in future versions (it requires a patch to the vt100 LynxOS terminal driver).

You will need a free console which the X server will use for keyboard input. You must disable login on at least one of the four virtual terminals in `/etc/ttys`, e.g. `/dev/atc3`:

    change
           /dev/atc3:1:default:vt100at:/bin/login

    to
           /dev/atc3:0:default:vt100at:/bin/login
                     ^

### X Server debug diagnostics output and other VT peculiarities

Output made by the X11R&relvers; X on its stdout or stderr will be lost after the server switches to graphics mode. The X11R&relvers; server stores its output in `/usr/adm/Xorg.n.log` (where `n` is the screen number).

When the X server is running output made to other consoles will be lost. After server shutdown the screen contents of other consoles may be inconsistent with what one would expect (i.e. random).

## Compiling the X11R&relvers; Distribution

The next sections contain LynxOS specific notes with respect to the build process.

### Disk space requirements

Currently there is no support for shared libraries in the LynxOS X11R&relvers; port. A complete binary installation along with manual pages will require approximately 250 MBytes of disk space. To compile the system you will need at least 350 MBytes of free disk space.

### Changes to system environment (LynxOS x86)

Before compiling the X11R&relvers; distribution you will have to make a few little adjustments to your system:

- If not already installed, on your `LynxOS 3.1.0a' system create a shell script named `/lib/cpp` as follows:

        #!/bin/sh
        /usr/lib/gcc-lib/i386-coff-lynxos/2.9-gnupro-98r2/cpp \
           -traditional "$@"

  On other platforms than the x86 the paths for the compiler support programs are different. You may use

        gcc -v

  to find out the correct path. Set the file mode of `/lib/cpp` with

        # chown root /lib/cpp
        # chmod 755 /lib/cpp

- Modify `/lib/liblynx.a`. On `LynxOS 3.1.0a' the X servers need the `smem_create()` system call to map the frame buffer into their address space. The system call is in `liblynx` library along with other Lynx proprietary calls which (unfortunately) overlap with calls in `libc`. To reduce confusion you should modify `liblynx` as follows:

        # mv /lib/liblynx.a /lib/liblynx.a.ORG
        # mkdir /tmp/xx; cd /tmp/xx
        # ar xv /lib/liblynx.a.ORG
        # ar rv /lib/liblynx.a *smem*
        # ranlib /lib/liblynx.a

### make World

If you have the MTRR device driver installed, add a line

        #define HasMTRRSupport YES

to the `config/cf/host.def` file.

You may then issue a

         make World

to compile X11R&relvers;. After some time (and hopefully a successful build of the X11R&relvers; system) you can install the software using

         make install

You must be logged in as super-user (root) when you invoke `make install'.

### Installing X11R&relvers; manual pages

LynxOS uses cat-able manual pages, and because a doc preparation system is definitely not a vital component of a real-time operating system you must first install groff-1.09 (or newer).

X11R&relvers; manual pages may be installed using

         make install.man

The index and whatis database for the X11R&relvers; manual pages will be created automatically. If you already have a whatis database or index file in the destination directories you should perform a sort/uniq operation to remove duplicate entries:

         for i in 1 3 5
         do
           rm -f /tmp/tmpfile
           sort /usr/X11R6/man/cat$i/LIST$i | uniq > /tmp/tmpfile
           mv /tmp/tmpfile /usr/X11R6/man/cat$i/LIST$i
         done
         sort /usr/X11R6/man/whatis | uniq > /tmp/tmpfile
         mv /tmp/tmpfile /usr/X11R6/man/whatis