[# Edit 8, Date 14-Sep-94, Module INSTALL #]   

Installation instructions for selection utility version 1.6
-----------------------------------------------------------

1. Creating the Devices
-----------------------

(The instructions below assume that you are using Nick Holloway's MAKEDEV
1.4, available from most Linux sites as MAKEDEV-1.4.tar.gz.)

 A. Make the mouse device. The procedure depends on whether you have a serial
    or a bus mouse.

    Serial mouse
    ------------

    - Check to make sure that you have at least devices ttyS0 and ttyS1 in
      /dev. If not, make them as follows:

	cd /dev; MAKEDEV ttyS0 ttyS1

    - Check to see which of the serial devices your mouse is connected to.
      The easiest way is to type:

	cat -uv /dev/ttyS0

      and move the mouse around randomly. If you get junk on your screen, you
      have the right device.  If not, try /dev/ttyS1.  Your mouse may even be
      on ttyS2 or ttyS3, for all I know.

    - Create a symbolic link for convenience as follows:

	cd /dev; ln -s ttyS0 mouse

      substituting ttyS1, ttyS2 or ttyS3 for ttyS0 as necessary.

    Bus mouse
    ---------

    - Check to make sure that you have the bus mouse devices logibm, psaux,
      inportbm and atibm in /dev. If not, make them as follows:

	cd /dev; MAKEDEV busmice

      (Of course, you only actually need the device corresponding to your
      mouse type.)

    - Create a symbolic link for convenience as follows:

	cd /dev; ln -s logibm mouse

      substituting psaux, inportbm or atibm for logibm as necessary.

 B. Make sure you have the /dev/tty0 (current VC) device, or /dev/console
    which should be a synonym for it. If not, make it as follows:

	cd /dev; MAKEDEV console

2. Testing the Mouse
--------------------

If you already have the selection mechanism configured in your kernel, you can
skip this step.  Otherwise, it is useful to check that selection will work
with your mouse before embarking on a kernel rebuild.

 -  Run selection with the `-D' option, and any other options necessary to
    specify mouse device, type, etc.  Selection will run as a foreground
    process, and will clear the screen.

 -  In the top left-hand corner of the screen, status information will be
    presented as mouse events are detected; the mouse x and y coordinates, the
    event type and the button state.  In addition, a moving digit will
    track mouse movement; the character will vary depending on which mouse
    buttons are currently down.  If any buttons are down, moving the mouse
    will leave a trail of digits.

 -  Test mode may be terminated by pressing CTRL-C.

3. Rebuilding The Kernel
------------------------

 -  Reconfigure the kernel if necessary by typing 'make config', remembering
    to include the selection mechanism by answering 'y' to the question:

      Selection (cut and paste for virtual consoles) (CONFIG_SELECTION)

    The default is for the selection mechanism to be disabled, so this step is
    important. In addition, if you are using a bus mouse, make sure that you
    include support for the mouse type when configuring the kernel by
    answering `y' to the appropriate question.

    If you do rebuild, to be safe, rebuild the kernel dependencies using `make
    dep' first.

    To check whether your kernel already has selection support built in, just
    try running `selection' as below.  If an error message of the form:

      selection: ioctl(TIOCLINUX, n): ...

    is generated, this means that the kernel needs rebuilding.

4. Test the program
-------------------

 -  There is a prebuilt binary included in the distribution, compiled with gcc
    2.5.8 and linked against libc 4.5.21. Run `selection' to test it out. Use
    `selection -?' to see what options are supported. Then type `make
    install.bin', which installs the executable in /sbin, and type `make
    install.man' to install the manual page in /usr/man, and start it up from
    /etc/rc.local (or wherever local initialization is performed at startup).

    Note: selection is installed set-UID so that the `-k' option can work
    correctly.

If you have trouble with bus mice, you are not alone.  Mike Battersby
<mike@starbug.apana.org.au> has written the Busmouse HOWTO (25 May 94),
available on most Linux sites.  This may help you in your difficulty.
Note that the section dealing with selection does not refer to the latest
version, and the selwrap program is no longer needed.

The default size of the paste buffer is 2048 bytes.  This may be changed by
altering the value of SEL_BUFFER_SIZE in /usr/src/linux/drivers/char/console.c
and rebuilding the kernel.

And that's all there is to it, hopefully.  See the manual page for a more
detailed description of operation.  Please let me know of any problems,
suggestions for enhancements, etc, etc.
