home *** CD-ROM | disk | FTP | other *** search
/ Linux 68k 2000 / Linux 68k 2000.iso / dokus / Busmouse-HOWTO < prev    next >
Encoding:
Text File  |  1997-11-15  |  19.8 KB  |  473 lines

  1.   The Linux Busmouse Howto
  2.   Chris Bagwell, cbagwell@sprynet.com
  3.   v1.5, 2 November 1997
  4.  
  5.   1.  Introduction.
  6.  
  7.   This document is a guide to getting your busmouse working with Linux.
  8.   During early kernel versions it was quite common to see questions come
  9.   up about how to get bus mice working under Linux.  With the more
  10.   advanced distributions available today the questions do not seem to
  11.   come up as often but there is still an audience for this FAQ.
  12.  
  13.   Busmouse support has been in the kernel for as long as I can remember,
  14.   and hasn't changed much in a long time, so this document should be
  15.   relevant to any version of Linux you're likely to have.
  16.  
  17.   1.1.  Disclaimer.
  18.  
  19.   The information in this document is correct to the best of my
  20.   knowledge, but there's a always a chance I've made some mistakes, so
  21.   don't follow everything too blindly, especially if it seems wrong.
  22.   Nothing here should have a detrimental effect on your computer, but
  23.   just in case I take no responsibility for any damages incurred from
  24.   the use of the information contained herein.
  25.  
  26.   Microsoft(R) is a Trademark of Microsoft Corporation.
  27.  
  28.   [ trademark notices for other mice, anyone? ]
  29.  
  30.   1.2.  Feedback.
  31.  
  32.   If you find any mistakes in this document, have any comments about its
  33.   contents or an update or addition, send them to me at the address
  34.   listed at the top of this howto.
  35.  
  36.   1.3.  Acknowledgements.
  37.  
  38.   This howto has been, in the spirit of Linux, a community effort.
  39.   Thanks goes out to Mike Battersby, mib@deakin.edu.au as he started
  40.   this FAQ and I have since started up-keep on it.  Any errors are most
  41.   likely mine.
  42.  
  43.   Many thanks go to Johan Myreen for the sections on the PS/2 mice,
  44.   Robert T. Harris for help on the ATI-XL sections and Reuben Sumner for
  45.   miscellaneous info and constructive criticism.
  46.  
  47.   Thanks also to the multitudes of people who have sent me mouse
  48.   information, fixes or words of encouragement.
  49.  
  50.   2.  Determining your mouse type.
  51.  
  52.   There are two separate but important characteristics you will need to
  53.   know about your mouse before you go on: what interface it uses and
  54.   what protocol it uses.  The interface is the hardware aspect of the
  55.   mouse, taking into account things like which i/o ports it uses and how
  56.   to check if it is installed.  This is the part which the kernel is
  57.   concerned with, so that it knows how to read data from the mouse.  The
  58.   protocol is the software aspect of the mouse.  Applications need to
  59.   know the protocol to interpret the raw mouse data they receive from
  60.   the kernel.
  61.  
  62.   2.1.  Mouse interfaces.
  63.  
  64.   The Linux kernel currently supports four different kinds of bus mouse
  65.   interface : Inport (Microsoft), Logitech, PS/2 and ATI-XL.  There is
  66.   no sure-fire way of determining your mouse interface --- mouse
  67.   developers generally do their own thing when it comes to standards.
  68.   The following sections may help, otherwise you'll just have to make it
  69.   up.
  70.  
  71.   2.2.  Inport mice.
  72.  
  73.   This includes most of the old style Microsoft mice which are shaped
  74.   like a bar of dove soap.  U.S. users who have purchased Gateway
  75.   computers should note that the mice that come with them are not Inport
  76.   mice but PS/2 mice (see below).  Inport mice generally connect to an
  77.   interface card which plugs into the bus on your motherboard.  If the
  78.   plug which connects your mouse cord to the interface card is round,
  79.   has 9 pins, and a notch in one side you likely have an Inport mouse.
  80.  
  81.   As far as I can tell, apart from the ATI-XL, all ATI mice (such as
  82.   those on the Graphics Ultra cards) are plain Inport mice.
  83.  
  84.   2.3.  Logitech mice.
  85.  
  86.   Logitech mice in general appear almost exactly the same as Inport
  87.   mice.  They too connect to an interface card via a 9 pin mini-din
  88.   connector.  Hopefully, it will have come in a Logitech box or have
  89.   ``Logitech'' printed on the connector card so that you can tell it
  90.   actually is a Logitech mouse.
  91.  
  92.   There are also some truly ancient Microsoft mice (ones with ball
  93.   bearings on the bottom as well as the mouse ball and a DB9 connector)
  94.   which also use the Logitech protocol.
  95.  
  96.   2.4.  PS/2 mice.
  97.  
  98.   PS/2 mice aren't really bus mice at all.  The PS/2 mouse interface is
  99.   not on an expansion card, the mouse is connected to the PS/2 Auxiliary
  100.   Device port on the keyboard controller.  A PS/2 mouse port uses a
  101.   6-pin mini DIN connector, similar to the keyboard connector.  Many
  102.   laptops also use this kind of interface to their trackballs --- except
  103.   for the connector, of course.
  104.  
  105.   2.5.  ATI-XL mice.
  106.  
  107.   ATI-XL mice are a variant of Inport mice, with some slight
  108.   differences.  They come on the ATI-XL combined video adaptor/mouse
  109.   card.  Unless you know you have an ATI-XL card (and thus an ATI-XL
  110.   mouse), you probably don't have one of these. It is possible for ATI-
  111.   XL mice to use either the ATI-XL or Inport kernel drivers, although
  112.   the ATI-XL driver should give better results.
  113.  
  114.   2.6.  Mouse protocols.
  115.  
  116.   The PC world is full of different and conflicting mouse protocols.
  117.   Fortunately, the choice for bus mice is considerable smaller than that
  118.   for serial mice.  Most Inport, Logitech and ATI-XL mice use the
  119.   ``BusMouse'' protocol, although there are some ancient Logitech mice
  120.   which use the ``MouseSystems'' protocol, and some even older Microsoft
  121.   mice which use the Logitech protocol.  PS/2 mice use the ``PS/2''
  122.   protocol.
  123.  
  124.   3.  Getting your mouse working.
  125.  
  126.   Once you have figured out your mouse interface and protocol types,
  127.   you're ready to proceed.
  128.  
  129.   3.1.  Setting the mouse interrupt.
  130.  
  131.   Now, you'll need to know which interrupt number your mouse is using,
  132.   and make sure it doesn't conflict with any other peripherals you have
  133.   installed.
  134.  
  135.   You should make sure that your mouse is not trying to use the same
  136.   interrupt as any of your other devices --- it is not possible for the
  137.   mouse to share an interrupt under Linux, even though it may work fine
  138.   under other operating systems.  Check the documentation for all your
  139.   peripherals to see which interrupt they use.  In most cases IRQ4 is
  140.   used for the first serial port (/dev/ttyS0), IRQ3 for the second
  141.   (/dev/ttyS1) (these are assuming you actually have such devices --- if
  142.   you don't you can happily use their IRQ's), and IRQ5 for some SCSI
  143.   adaptors.
  144.  
  145.   Note that for ATI-XL, Inport and Logitech mice the kernel default is
  146.   to use IRQ5, so if you are stuck with a pre-compiled kernel (eg, CD-
  147.   ROM users) you will have to use that.  If you are using an Inport or
  148.   Logitech mice with a newer kernel you may be able to pass a command
  149.   line option to the kernel to tell it what interrupt to use without
  150.   recompiling.
  151.  
  152.   3.2.  Inport and Logitech mice.
  153.  
  154.   If you open up your computer's case and look at the card which your
  155.   mouse plugs into, you should notice a block of jumpers on the card
  156.   (hopefully labeled ``INTERRUPT'') with positions for interrupt
  157.   (otherwise known as IRQ) numbers 2,3,4 and 5.  To change the interrupt
  158.   simply move the jumper from its current position onto the correct pair
  159.   of pins.
  160.  
  161.        ***************************************************
  162.        ***     MAKE SURE YOUR COMPUTER IS TURNED OFF   ***
  163.        ***     BEFORE CHANGING THE JUMPERS AROUND.     ***
  164.        ***************************************************
  165.  
  166.   3.3.  ATI-XL mice.
  167.  
  168.   ATI-XL busmice have a software selectable IRQ - you should have
  169.   received with your mouse a MS-DOS program (VSETUP.EXE) to set the IRQ.
  170.   In order to do so you must (temporarily) boot MS-DOS and run this
  171.   program.  Note that the VSETUP program takes an optional parameter
  172.   ``/70'' to increase the vertical refresh rate (which results in less
  173.   flicker).  The VSETUP program also allows you to select either the
  174.   primary or secondary mouse address - you should set this to the
  175.   primary address or the kernel will not be able to detect your mouse.
  176.  
  177.   Once VSETUP has been run you must perform a hard reset for the new
  178.   configuration to take effect.
  179.  
  180.   3.4.  PS/2 mice.
  181.  
  182.   The PS/2 mouse always uses IRQ12 -- there is no way of changing this
  183.   (except with a soldering gun.)  In the rare case that some other
  184.   device is using IRQ12, you'll have to rejumper that peripheral to use
  185.   another IRQ number.
  186.  
  187.   3.5.  Compiling the kernel.
  188.  
  189.   In order for your busmouse to operate correctly you will need to
  190.   compile your kernel with the busmouse support compiled in.  If you are
  191.   using a pre-compiled kernel then it often comes with support for all
  192.   three busmouse included.  This may still not be enough.  The kernel
  193.   could be trying to use the wrong interrupt or the detection can get
  194.   confused and treat your mouse as the wrong type.  When in doubt, try
  195.   recompiling your kernel with only support for your mouse type and set
  196.   it to use the correct interrupt.
  197.  
  198.   Change to your kernel directory (here assumed to be (/usr/src/linux)
  199.   and do a
  200.  
  201.        make config
  202.  
  203.   If you are unsure as to your mouse type, the first time you recompile
  204.   the kernel you may wish to enable all of the busmouse options in the
  205.   hope that the kernel will autodetect your mouse properly.  People have
  206.   mixed success with this: it doesn't always work, but on the other hand
  207.   it might save you any further compiles.
  208.  
  209.   3.5.1.  Inport, Logitech and ATI-XL mice
  210.  
  211.   Answer ``y'' to the question pertaining to your type of busmouse
  212.   interface and ``n'' to all the other busmouse questions.  For example,
  213.   if you have an Inport mouse you should answer ``y'' to
  214.  
  215.        Microsoft busmouse support
  216.  
  217.   and ``n'' to all other busmouse questions.  Answer the non-mouse
  218.   related questions as you usually would.
  219.  
  220.   If you have a Logitech or Inport mouse, edit the file
  221.   /usr/src/linux/include/linux/busmouse.h and change the line which says
  222.  
  223.        #define MOUSE_IRQ               5
  224.  
  225.   to reflect the interrupt number for your mouse (see the section ``Set¡
  226.   ting the mouse interrupt'' for details on finding your interrupt num¡
  227.   ber).
  228.  
  229.   If you have an ATI-XL mouse, edit the file
  230.   /usr/src/linux/drivers/char/atixlmouse.c and change the line which
  231.   says
  232.  
  233.        #define ATIXL_MOUSE_IRQ         5
  234.  
  235.   to reflect your mouse's interrupt number.
  236.  
  237.   Due to the vagaries of the PC architecture, if you have set your mouse
  238.   to use interrupt 2, you must set the #define to use interrupt 9.
  239.  
  240.   Examples
  241.  
  242.   For a mouse on interrupt 3, you should change the line to read
  243.  
  244.        #define MOUSE_IRQ               3
  245.  
  246.   For a mouse on interrupt 2, you should change the line to read
  247.  
  248.        #define MOUSE_IRQ               9
  249.  
  250.   Next, compile your kernel as per the instructions which come with it,
  251.   and boot from the new kernel.  You should now have the busmouse
  252.   support correctly compiled in.
  253.  
  254.   The steps to change the interrupt the kernel uses works with any
  255.   version of the kernel to date.  Newer kernels (starting somewhere in
  256.   the 2.x's) allow you to pass arguments to the kernel during boot up
  257.   using something like LILO or LOADLIN to specify the interrupt number
  258.   for Logitech and Microsoft Inport mice. This can be a real time saver
  259.   as you do not need to recompiler your kernel (or know how to).
  260.  
  261.   You can add the following options to your boot line in LILO to change
  262.   interrupt:
  263.  
  264.        bmouse=3  (Logitech Busmice)
  265.        msmouse=3 (for Microsoft Inport mice)
  266.  
  267.   Substitute the 3 with your mouse's actual interrupt. An example of
  268.   using this with lilo is:
  269.  
  270.        LILO:linux msmouse=3
  271.  
  272.   3.5.2.  PS/2 mice
  273.  
  274.   To compile the kernel with PS/2 mouse support answer ``y'' to the
  275.   question.
  276.  
  277.        PS/2 mouse (aka "auxiliary device") support
  278.  
  279.   The PS/2 mouse driver actually supports two kinds of devices: the
  280.   standard PS/2 Auxiliary Device controller and a special PS/2 mouse
  281.   interface chip from Chips & Technologies which is used in the Texas
  282.   Instruments Travelmate and Gateway Nomad laptops.  To compile in
  283.   support for the trackballs on these computers, answer ``y'' to the
  284.  
  285.        C&T 82C710 mouse port support (as on TI Travelmate)
  286.  
  287.   question.  Note that you will still have to answer ``y'' to the ques¡
  288.   tion about the standard PS/2 driver to even get a chance to answer
  289.   this question, since the 82C710 driver is actually an add-on to the
  290.   standard PS/2 mouse driver.
  291.  
  292.   When configured both for a standard PS/2 mouse device and the 82C710
  293.   device, the driver first tries to locate a 82C710 chip at boot time.
  294.   Failing this, the standard driver is used instead, so using a kernel
  295.   configured for both types of interface on a machine with a standard
  296.   PS/2 mouse port should work too.  However, there has been one report
  297.   of a falsely detected 82C710 chip, so to be on the safe side do not
  298.   configure in support for the 82C710 if you don't need it.
  299.  
  300.   Compile your new kernel and boot from it as you normally would.
  301.  
  302.   3.5.3.  Selection
  303.  
  304.   It appears that in older kernels you had to compile in support to use
  305.   the program Selection (so you can cut and past from virtual consoles).
  306.   This option does not appear in modern kernels and the program
  307.   Selection has generally been replaced with the program gpm (see the
  308.   section ``gpm'' for more details).
  309.  
  310.   If you are working with an old kernel then you may wish to set this
  311.   option to ``y'' regardless of your mouse type so that you may use the
  312.   Selection program.
  313.  
  314.   3.6.  The mouse devices.
  315.  
  316.   Mice under Linux are accessed via the devices in the /dev directory.
  317.   The following table gives a list of interface types and which device
  318.   you should use.
  319.  
  320.   INTERFACE        DEVICE        MAJOR    MINOR
  321.   ---------------------------------------------
  322.   Logitech        /dev/logibm      10      0
  323.   PS/2            /dev/psaux       10      1
  324.   Inport          /dev/inportbm    10      2
  325.   ATI-XL          /dev/atibm       10      3
  326.  
  327.       Table 1.  Mouse devices.
  328.  
  329.      Note:
  330.         If you are using your ATI-XL mouse with the Inport driver, you
  331.         should use the inportbm device, not the /dev/atibm device.
  332.  
  333.   The major and minor entries are the device numbers for that particular
  334.   device.
  335.  
  336.   If you find that you do not have these devices, you should create them
  337.   first.  To do so, execute the following as root.
  338.  
  339.        mknod /dev/logimm    c 10 0
  340.        mknod /dev/psaux     c 10 1
  341.        mknod /dev/inportbm  c 10 2
  342.        mknod /dev/atibm     c 10 3
  343.  
  344.      Note:
  345.         Some time in the (progressively less) recent history of Linux
  346.         the names for the busmouse devices have changed.  The following
  347.         device names have been superceded by those above and should be
  348.         removed: bmousems, bmouseps2, bmouseatixl, and bmouselogitech..
  349.  
  350.   Many people like to create a symbolic link from their mouse device to
  351.   /dev/mouse so that they don't have to remember which device they need
  352.   to be using.  If you have one of the current Linux distributions you
  353.   will almost certainly find that you have such a link.  If you have
  354.   such a link, or create one, you should make sure that it is pointing
  355.   to the correct device for your mouse.
  356.  
  357.   4.  Using your mouse.
  358.  
  359.   4.1.  gpm.
  360.  
  361.   Gpm is a program which allows you to do mouse based 'cut- and-paste'
  362.   between virtual consoles under Linux and is a good way of testing your
  363.   mouse out. The current version of Gpm is gpm-1.13.tar.gz
  364.   <http://sunsite.unc.edu/pub/Linux/system/mouse/gpm-1.13.tar.gz> and
  365.   can be found at your friendly Linux FTP site (such as
  366.   sunsite.unc.edu), and contains instructions for getting it compiled.
  367.   Some Linux distributions, such as Red Hat, come with a precompiled gpm
  368.   binary.
  369.  
  370.   When invoking gpm, use the -t switch to indicate which protocol your
  371.   mouse is using and the -m option to indicate which mouse device you
  372.   are using.  Three protocols useful for most busmice are logi, bm, and
  373.   ps2.  The default for mouse device is to use /dev/mouse, so you can
  374.   omit the -m option if you have the appropriate symbolic link.  An
  375.   example for a Microsoft Inport mouse is:
  376.  
  377.        gpm -t bm
  378.  
  379.   or if you use the PS/2 protocol:
  380.  
  381.        gpm -t ps2
  382.  
  383.   You should then be able move your mouse and see a block move around
  384.   the screen and also be able to cut and paste text between virtual
  385.   consoles using the mouse buttons.  Read the documentation with gpm, or
  386.   do a ``man gpm'' for more information on how to operate it.
  387.  
  388.   4.2.  XFree86.
  389.  
  390.   To use your busmouse under XFree86, you will need to set your mouse
  391.   protocol type in your Xconfig file. If you have a BusMouse protocol
  392.   mouse, your Xconfig should contain (including the quotes)
  393.  
  394.        Section "Pointer"
  395.          Protocol "Busmouse"
  396.          Device   "/dev/mouse"
  397.  
  398.          # Any other options such as Emulate3Buttons
  399.        EndSection
  400.  
  401.   For PS/2 mice change the protocol line to:
  402.  
  403.          Protocol        "PS2"
  404.  
  405.   If you have a two button mouse, it should also contain the line
  406.  
  407.          Emulate3Buttons
  408.  
  409.   which will allow you to emulate the use of the middle mouse button by
  410.   pressing both mouse buttons simultaneously.  All other mouse related
  411.   lines, such as ``BaudRate'' and ``SampleRate'' should be commented
  412.   out, as these have no effect on bus mice.
  413.  
  414.   4.3.  XFree86 and gpm.
  415.  
  416.   For a long period of the kernel developement, it was not possible to
  417.   share busmice between processes.  Because of this it was hard to run
  418.   both XFree86 and gpm at the same time. If you try to run X with gpm
  419.   running and you get errors like the following then you know you are
  420.   using one of these older kernels.
  421.  
  422.        Fatal server error:
  423.        Cannot open mouse (Device or resource busy)
  424.  
  425.   There are two meathods of getting gpm working with XFree86 with these
  426.   kernels.  The first is to kill any copy of gpm you have running before
  427.   you start up XFree86.  The second is to use gpm's "repeater" option
  428.   (it takes mouse data and repeats the information to multiple
  429.   applications).
  430.  
  431.   I would recommend upgrading your kernel if possible so that you can
  432.   share busmice between processes.  For this document, I will only
  433.   explain the simplest meathod of using XFree86 and gpm together with
  434.   older kernels.  Please see gpm's documentation if you would like to
  435.   use the repeater meathod.
  436.  
  437.   Gpm allows you to terminate running copies of itself by executing:
  438.  
  439.        gpm -k
  440.  
  441.   This should be done before starting up X11.  Take whatever script you
  442.   use to start up your X session, such as startx, and add the above com¡
  443.   mand to the top of the script so that gpm is shut down automatically.
  444.   You may wish to also put a command that restarts gpm at the bottom of
  445.   the script so that it restarts upon exiting your X session.
  446.  
  447.   5.  Still can't get your mouse going?
  448.  
  449.   So you've read through this howto a dozen times, done everything
  450.   exactly as you think you should have, and your mouse still doesn't
  451.   work?  The best advice I can give you is this: experiment.  Sure, it's
  452.   a pain in the posterior, but in the end the only way to find out what
  453.   is going to work with your mouse is to try all of the alternatives
  454.   until you have success.
  455.  
  456.   As always, if there is something you don't understand, try reading the
  457.   manual page first and see if that helps.  If you have a specific
  458.   question, or a problem you think I might be able to help with, feel
  459.   free to contact me at the address listed at the top of this howto, and
  460.   I'll see if I can help you out or point you to someone who can.
  461.  
  462.   The comp.os.linux.setup newsgroup or comp.os.linux.hardware is the
  463.   appropriate forum for discussion and/or questions regarding setup ---
  464.   please don't post questions to other groups, and especially don't
  465.   crosspost questions to two or more of the Linux groups, they are more
  466.   than cluttered enough as it is!  When posting, you will get a much
  467.   better response (and much fewer flames) if you use appropriate
  468.   Subject: and Keywords: lines.  For example:
  469.  
  470.   Subject: BUSMICE - Gateway 2000 mouse wont work.
  471.   Keywords: mouse busmouse gateway
  472.  
  473.