Add the ps2 mouse stuff.
authorJordan K. Hubbard <jkh@FreeBSD.org>
Sat, 16 Apr 1994 20:37:29 +0000 (20:37 +0000)
committerJordan K. Hubbard <jkh@FreeBSD.org>
Sat, 16 Apr 1994 20:37:29 +0000 (20:37 +0000)
contrib/FAQ/programs/psm/README [new file with mode: 0644]
contrib/FAQ/programs/psm/isa.patch [new file with mode: 0644]
contrib/FAQ/programs/psm/mouse.h [new file with mode: 0644]
contrib/FAQ/programs/psm/psm.uue [new file with mode: 0644]
contrib/FAQ/programs/psm/psm0 [new file with mode: 0644]

diff --git a/contrib/FAQ/programs/psm/README b/contrib/FAQ/programs/psm/README
new file mode 100644 (file)
index 0000000..8c54700
--- /dev/null
@@ -0,0 +1,58 @@
+This is a set of instructions and files necessary to get the PS/2 mouse
+working with FreeBSD. 
+
+First, some explanations are in order as to why it doesn't work now.
+
+The PS/2 mouse is an extension of the keyboard controller, so it uses
+the same 'port' as the keyboard.  Even though it uses a different
+interrupt it's possible to have both processes trying to read from the
+same port at the same time, which can cause keyboard and/or mouse
+lockups.  If everything works right nothing bad should happen, but there
+are possibilities for problems due to two different drivers reading from
+the same area in memory.
+
+The bottom line is that it's bad for two drivers to use the same
+interrupt, I/O address (port), memory address, or any part of the system
+that is used for another device driver.  Code was added to
+/sys/i386/isa/isa.c to not allow this to happen.
+
+The real solution to the problem is to integrate the PS/2 mouse driver
+into the keyboard controller so that it can differentiate between
+keyboard and mouse events, but until that happens here is the
+workaround.
+
+Note, this driver is *known* to cause some keyboard lockups with certain
+controllers and is not guaranteed to work all the time, but I will admit
+that I am using this driver on quite a number of machines I support with
+only rare problems which are easily fixed with a reboot.
+
+What is needed is to add the driver to your system and to patch isa.c to
+allow both device drivers to occupy the same I/O address.  Then you need
+to add the device driver line to you kernel configuration file and rebuild
+the kernel.  Finally, you need to make the appropriate /dev entries for
+the ps/2 mouse.
+
+1) Copy the file psm.c to /sys/i386/isa
+
+2) Copy the file mouse.h /sys/i386/include
+
+3) Patch the file /sys/i386/isa/isa.c with the file isa.patch
+
+4) Add this line to your kernel config file:
+
+device          psm0    at isa? port "IO_KBD" tty irq 12 vector psmintr
+
+5) Configure and remake your kernel (Do a make clean before starting to
+   make sure everything gets rebuilt)
+
+6) Make the new /dev entries as 'MAKEDEV psm00' in /dev.
+
+7) Boot the new kernel.  (Do all the necessary steps to make sure you
+   don't hose yourself here)
+
+8) At this point you'll probably want to point X at the new mouse, so
+   modify the mouse line in Xconfig to say something like:
+
+PS/2           "/dev/psm0"
+
+9) Start X and be happy.
diff --git a/contrib/FAQ/programs/psm/isa.patch b/contrib/FAQ/programs/psm/isa.patch
new file mode 100644 (file)
index 0000000..15cc849
--- /dev/null
@@ -0,0 +1,48 @@
+From tinguely@plains.NoDak.edu Thu Feb 24 11:00:29 MST 1994
+Article: 9561 of comp.os.386bsd.questions
+Newsgroups: comp.os.386bsd.questions
+Path: usenet.coe.montana.edu!netnews.nwnet.net!ns1.nodak.edu!plains.NoDak.edu!tinguely
+From: tinguely@plains.NoDak.edu (Mark Tinguely)
+Subject: Re: psm driver - how to install?
+Sender: usenet@ns1.nodak.edu (Usenet login)
+Message-ID: <CLoqGJ.EK8@ns1.nodak.edu>
+Date: Wed, 23 Feb 1994 16:14:43 GMT
+References: <2kclki$su@pilhuhn.pilhuhn.sub.org> <2kdlh6$373@pdq.coe.montana.edu>
+Nntp-Posting-Host: plains.nodak.edu
+Organization: North Dakota State University
+Lines: 32
+
+In article <2kdlh6$373@pdq.coe.montana.edu> nate@bsd.coe.montana.edu (Nate Williams) writes:
+>In article <2kclki$su@pilhuhn.pilhuhn.sub.org>,
+>Patrick M.Hausen <pmh@pilhuhn.sub.org> wrote:
+>This is due to the way the PS/2 mouse works.  You need to comment out the
+>lines in i386/isa.c which don't allow multiple device drivers to exist on
+>the same port.  However, as this implies, you *may* have problems with certain
+>hardware and keyboard lockups due to this.  I have machines that work fine,
+>and others that lockup using that mouse driver.
+
+instead of totally commenting out the conflict check, I just "overlooked"
+the duplicate keyboard/mouse conflict.
+
+*** isa.c.orig Wed Feb 23 10:09:58 1994
+--- isa.c      Wed Feb 23 10:08:51 1994
+***************
+*** 122,128 ****
+               if (tmpdvp->id_alive != -1) {
+                       if ((dvp->id_iobase >= tmpdvp->id_iobase) &&
+                           (dvp->id_iobase <=
+!                                (tmpdvp->id_iobase + tmpdvp->id_alive - 1))) {
+                               conflict(dvp, tmpdvp, dvp->id_iobase,
+                                        "I/O address", "0x%x");
+                               status = 1;
+--- 122,129 ----
+               if (tmpdvp->id_alive != -1) {
+                       if ((dvp->id_iobase >= tmpdvp->id_iobase) &&
+                           (dvp->id_iobase <=
+!                                (tmpdvp->id_iobase + tmpdvp->id_alive - 1))
+! /* for ps/2 mouse */                 && dvp->id_iobase != 0x60 ) {
+                               conflict(dvp, tmpdvp, dvp->id_iobase,
+                                        "I/O address", "0x%x");
+                               status = 1;
+
+
diff --git a/contrib/FAQ/programs/psm/mouse.h b/contrib/FAQ/programs/psm/mouse.h
new file mode 100644 (file)
index 0000000..47720da
--- /dev/null
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 1992, 1993 Erik Forsberg.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *     $Id: mouse.h,v 1.2 1993/08/02 17:52:25 mycroft Exp $
+ */
+
+struct mouseinfo {
+       unsigned char status;
+       char xmotion, ymotion;
+};
+
+#define BUTSTATMASK    0x07    /* Any mouse button down if any bit set */
+#define BUTCHNGMASK    0x38    /* Any mouse button changed if any bit set */
+
+#define BUT3STAT       0x01    /* Button 3 down if set */
+#define BUT2STAT       0x02    /* Button 2 down if set */
+#define BUT1STAT       0x04    /* Button 1 down if set */
+#define BUT3CHNG       0x08    /* Button 3 changed if set */
+#define BUT2CHNG       0x10    /* Button 2 changed if set */
+#define BUT1CHNG       0x20    /* Button 1 changed if set */
+#define MOVEMENT       0x40    /* Mouse movement detected */
+
+/* Ioctl definitions */
+
+#define MOUSEIOC        ('M'<<8)
+#define MOUSEIOCREAD   (MOUSEIOC|60)
diff --git a/contrib/FAQ/programs/psm/psm.uue b/contrib/FAQ/programs/psm/psm.uue
new file mode 100644 (file)
index 0000000..2367317
--- /dev/null
@@ -0,0 +1,94 @@
+begin 644 psm.c.gz
+M'XL(")FL?BT``W!S;2YC`*U:>U?;2++_6WR*NKEG&3L8\PB39.*$&V,+T(ZQ
+M64M.8&=SV$9N02^RY-$#XYW)?O:MZH<>QLYD]]R<$[!;]>ZJ7U6WV'NYNP4O
+MH1?/EXFXN\^@X3?AX*>?#EOT\Q78B7B`TSA);WERUR;2;AB")$TAX2E/'OF4
+MUNG1F$]%FB7B-L]$'`&+II"G'$0$:9PG/I<KMR)BR1*".)FE+5B([![B1/Z.
+M\XRDS.*I"(3/2$8+6,)ASI.9R#(^A7D2/XHI?LCN688_.,H)PW@AHCOPXV@J
+MB"DE*<0WX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6J`O+/3
+M,<=+V#T&<\"D(42UN_J(:H:3!7O@>6TH:4JT+1*6SI5:``\UM5DW4\K*^?-K
+M!5S5NX;5DTBRV'C\2.D5[J:#QQ^CH"OHKV+H+W.D8GE9K]_I%F?X9$%#W^GG
+ML>/9E</WOAGR=9*@?EF(3",:3<S8%!Z9"%DQ.ZU,F-7A0VZ+ED_EC8]E;?]6
+CC]A\]WA^,Q?33D&I8EB629&?^$MFIWDGO_5O#/&20DLI``"+
+`
+end
diff --git a/contrib/FAQ/programs/psm/psm0 b/contrib/FAQ/programs/psm/psm0
new file mode 100644 (file)
index 0000000..a0453b2
--- /dev/null
@@ -0,0 +1 @@
+device          psm0    at isa? port "IO_KBD" tty irq 12 vector psmintr