README for XFree86 on FreeBSD : Configuring X for Your Hardware
Previous: Installing The Display Manager (xdm)
Next: Running X

4. Configuring X for Your Hardware

The XF86Config file tells the X server what kind of monitor, video card and mouse you have. You must create it to tell the server what specific hardware you have.

It is strongly recommended that you read through the QuickStart guide, and use either the `XF86Setup' utility (which requires the VGA16 server to be installed), or the `xf86config' utility to generate an XF86Config file.

When you run the `XF86Setup' utility, do NOT touch the mouse until you are finished with mouse set up. Otherwise, the VGA16 server and the mouse device driver may get confused and you may experience mouse and/or keyboard input problems.

If you are running ``moused'' (see the man page for moused(8)) in FreeBSD versions 2.2.1 or later, you MUST specify SysMouse as the mouse protocol type and /dev/sysmouse as the mouse device name, regardless of the brand and model of your mouse.

If you are NOT running ``moused'', you need to know the interface type of your mouse, /dev entry and the protocol type to use.

The interface type can be determined by looking at the connector of the mouse. The serial mouse has a D-Sub female 9- or 25-pin connector. The bus mouse has either a D-Sub male 9-pin connector or a round DIN 9-pin connector. The PS/2 mouse is equipped with a small, round DIN 6-pin connector. The USB mouse has a flat rectangular connector. Some mice come with adapters with which the connector can be converted to another. If you are to use such an adapter, remember the connector at the very end of the mouse/adapter pair is what matters.

The next thing to decide is a /dev entry for the given interface. For the bus and PS/2 mice, there is little choice: the bus mouse always use /dev/mse0, and the PS/2 mouse is always at /dev/psm0. You can attach multiple USB mice to your system or to your USB hub. They are accessible as /dev/ums0, /dev/ums1,... There may be more than one serial port to which the serial mouse can be attached. Many people often assign the first, built-in serial port /dev/cuaa0 to the mouse.

If you are not sure which serial device your mouse is plugged into, the easiest way to find out the device is to use ``cat'' or ``kermit'' to look at the output of the mouse. Connect to it and just make sure that it generates output when the mouse is moved or clicked:

 % cat < /dev/tty00

If you can't find the right mouse device then use ``dmesg|grep sio'' to get a list of serial devices that were detected upon booting:

 % dmesg|grep sio
 sio0 at 0x3f8-0x3ff irq 4 on isa

Then double check the /dev entries corresponding to these devices. Use the script /dev/MAKEDEV to create entries if they don't already exist:

 % cd /dev
 % sh MAKEDEV tty00

You may want to create a symbolic link /dev/mouse pointing to the real port to which the mouse is connected, so that you can easily distinguish which is your ``mouse'' port later.

The next step is to guess the appropriate protocol type for the mouse. In FreeBSD 2.2.6 or later, the X server may be able to automatically determine the appropriate protocol type, unless your mouse is of a relatively old model. Use the ``Auto'' protocol in these versions.

In other versions of FreeBSD or if the ``Auto'' protocol doesn't work in 2.2.6, you have to guess a protocol type and try.

There is rule of thumb:

  1. The bus mice always use the ``BusMouse'' protocol regardless of the brand of the mouse.
  2. The ``PS/2'' protocol should always be specified for the PS/2 mouse regardless of the brand of the mouse.
    NOTE: There are quite a few PS/2 mouse protocols listed in the man page for XF86Config. But, ``PS/2'' is the only PS/2 mouse protocol type useful in XF86Config for FreeBSD. The other PS/2 mouse protocol types are not supported in FreeBSD. FreeBSD version 2.2.6 and later directly support these protocol types in the PS/2 mouse driver psm and it is not necessary to tell the X server which PS/2 mouse protocol type is to be used; ``Auto'' should work, otherwise use ``PS/2''.
  3. You must specify the ``Auto'' protocol for the USB mouse.
    NOTE: Other XFree86 document may mention ``Usb'' as one of keywords for the mouse protocol. This keyword is not necessary, thus, not supported in FreeBSD. Be sure to use ``Auto'' for the USB mouse.
  4. The ``Logitech'' protocol is for old mouse models from Logitech. Modern Logitech mice use either the ``MouseMan'' or ``Microsoft'' protocol.
  5. Most 2-button serial mice support the ``Microsoft'' protocol.
  6. 3-button serial mice may work with the ``MouseSystems'' protocol. If it doesn't, it may work with the ``Microsoft'' protocol although the third (middle) button won't function. 3-button serial mice may also work with the ``MouseMan'' protocol under which the third button may function as expected.
  7. 3-button serial mice may have a small switch to choose between ``MS'' and ``PC'', or ``2'' and ``3''. ``MS'' or ``2'' usually mean the ``Microsoft'' protocol. ``PC'' or ``3'' will choose the ``MouseSystems'' protocol.
  8. If the serial mouse has a roller or a wheel, it may be compatible with the ``IntelliMouse'' protocol.

README for XFree86 on FreeBSD : Configuring X for Your Hardware
Previous: Installing The Display Manager (xdm)
Next: Running X