<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Configuring X for Your Hardware</TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">

<A HREF="FreeBSD.html"><EM> README for XFree86 on FreeBSD</EM></A>
 <b>:</b> <EM>Configuring X for Your Hardware</EM><BR>
<b>Previous:</b> <A HREF="FreeBSD3.html"><EM>Installing The Display Manager (xdm)</EM></A><BR>
<b>Next:</b> <A HREF="FreeBSD5.html"><EM>Running X</EM></A>


<HR NOSHADE>
  <H2><A NAME="4"></A>4. Configuring X for Your Hardware</H2>
<p>The <code>XF86Config</code> file tells the X server what kind of monitor, video card
and mouse you have.  You <em>must</em> create it to tell the server what
specific hardware you have.</p>
<p>It is strongly recommended that you read through the <A href="QuickStart.html">QuickStart guide</A>, and use either
the `XF86Setup' utility (which requires the VGA16 server to be installed),
or the `xf86config' utility to generate an XF86Config file.</p>
<p>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.</p>
<p>If you are running ``<code>moused</code>'' (see the man page for <code>moused(8)</code>)
in FreeBSD versions 2.2.1 or later,
you MUST specify <code>SysMouse</code> as the mouse protocol type 
and <code>/dev/sysmouse</code> as the mouse device name,
regardless of the brand and model of your mouse.</p>
<p>If you are NOT running ``<code>moused</code>'', you need to know the interface
type of your mouse, <code>/dev</code> entry and the protocol type to use.</p>
<p>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.
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.</p>
<p>The next thing to decide is a <code>/dev</code> entry for the given interface.
For the bus and PS/2 mice, there is little choice: 
the bus mouse always use <code>/dev/mse0</code>,
and the PS/2 mouse is always at <code>/dev/psm0</code>.
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 <code>/dev/cuaa0</code> to the mouse.</p>
<p>If you are not sure which serial device your mouse is plugged into, 
the easiest way to find out the device is to
use ``<code>cat</code>'' or ``<code>kermit</code>'' 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:</p>
<p>
<blockquote><code>
<pre>
 % cat &lt; /dev/tty00
</pre>
</code></blockquote>
</p>
<p>If you can't find the right mouse device then use ``<code>dmesg|grep
sio</code>'' to get a list of serial devices that were detected upon booting:</p>
<p>
<blockquote><code>
<pre>
 % dmesg|grep sio
 sio0 at 0x3f8-0x3ff irq 4 on isa
</pre>
</code></blockquote>
</p>
<p>Then double check the <code>/dev</code> entries corresponding to these
devices.  Use the script <code>/dev/MAKEDEV</code> to create entries if
they don't already exist:</p>
<p>
<blockquote><code>
<pre>
 % cd /dev
 % sh MAKEDEV tty00
</pre>
</code></blockquote>
</p>
<p>You may want to create a symbolic link <code>/dev/mouse</code>
pointing to the real port to which the mouse is connected, so that you
can easily distinguish which is your ``mouse'' port later.</p>
<p>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 ``<code>Auto</code>'' protocol in these versions.</p>
<p>In other versions of FreeBSD or if the ``<code>Auto</code>'' protocol
doesn't work in 2.2.6, you have to guess a protocol type and try.</p>
<p>There is rule of thumb:</p>
<p>
<ol>
<li>The bus mice always use the ``<code>BusMouse</code>''
protocol regardless of the brand of the mouse.</li>
<li>The ``<code>PS/2</code>'' protocol should always be specified for 
the PS/2 mouse regardless of the brand of the mouse.
<blockquote>
<b>NOTE:</b> There are quite a few PS/2 mouse protocols listed in the man page
for <code>XF86Config</code>.  But, ``<code>PS/2</code>'' is the only PS/2 mouse 
protocol type useful in <code>XF86Config</code> 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 <code>psm</code> and it is not
necessary to tell the X server which PS/2 mouse protocol type is to 
be used; ``<code>Auto</code>'' should work, otherwise use ``<code>PS/2</code>''.
</blockquote>
</li>
<li>The ``<code>Logitech</code>'' protocol is for old mouse models 
from Logitech.
Modern Logitech mice use either the ``<code>MouseMan</code>''
or ``<code>Microsoft</code>'' protocol.</li>
<li>Most 2-button serial mice support the ``<code>Microsoft</code>'' protocol.</li>
<li>3-button serial mice may work with the ``<code>MouseSystems</code>''
protocol. If it doesn't, it may work with the ``<code>Microsoft</code>''
protocol although the third (middle) button won't function.
3-button serial mice may also work with the ``<code>MouseMan</code>''
protocol under which the third button may function as expected.</li>
<li>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 ``<code>Microsoft</code>'' protocol.
``PC'' or ``3'' will choose the ``<code>MouseSystems</code>'' protocol.</li>
<li>If the serial mouse has a roller or a wheel, it may be compatible 
with the ``<code>IntelliMouse</code>'' protocol.</li>
</ol>
</p>

 <HR NOSHADE>
<A HREF="FreeBSD.html"><EM> README for XFree86 on FreeBSD</EM></A>
 <b>:</b> <EM>Configuring X for Your Hardware</EM><BR>
<b>Previous:</b> <A HREF="FreeBSD3.html"><EM>Installing The Display Manager (xdm)</EM></A><BR>
<b>Next:</b> <A HREF="FreeBSD5.html"><EM>Running X</EM></A>



</BODY>
</HTML>
