Bug 17610

Summary: mouse does not work after compiling 4.0-stable
Product: Base System Reporter: sparhawk <sparhawk>
Component: miscAssignee: yokota <yokota>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description sparhawk 2000-03-27 00:20:01 UTC
I have a ps/2 intellimouse pluged into a kvm switch. During install and setup of 4.0-release the mouse works fine.  Using 4.0-release, the mouse works fine.  If I cvsup to 4.0-stable or 5.0-current, the mouse no longer works.

I have moused="yes" in rc.conf, the moused commandline looks like this.
moused -p /dev/psm0 -t auto.

I have tried auto, ps/2 and intellimouse as the type. 

The mouse also doesn't work under X.

How-To-Repeat: Plug mouse into kvm and upgrade to 4.0-stable.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-29 11:28:53 UTC
Responsible Changed
From-To: freebsd-bugs->yokota

Kazu, can you take this one? 

Comment 2 yokota 2000-03-30 08:15:23 UTC
>>Number:         17610
>>Category:       misc
>>Synopsis:       mouse does not work after compiling 4.0-stable
[...]
>>Originator:     David Foresman
>>Release:        4.0-release
>>Organization:
>n/a
>>Environment:
>FreeBSD sparhawk.ce.mediaone.net 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Sun Mar 2
>6 15:25:02 CST 2000     root@sparhawk.ce.mediaone.net:/usr/src/sys/compile/SPA
>RHAWK  i386
>
>>Description:
>I have a ps/2 intellimouse pluged into a kvm switch. During install and setup 
>of 4.0-release the mouse works fine.  Using 4.0-release, the mouse works fine.
>  If I cvsup to 4.0-stable or 5.0-current, the mouse no longer works.
>
>I have moused="yes" in rc.conf, the moused commandline looks like this.
>moused -p /dev/psm0 -t auto.
>
>I have tried auto, ps/2 and intellimouse as the type. 
>
>The mouse also doesn't work under X.
>>How-To-Repeat:
>Plug mouse into kvm and upgrade to 4.0-stable.

We need to verify several things.

First, is your kernel and userland in sync?  You need to do `make
world' and rebuild the kernel after cvsupping RELENG_4 or HEAD
(5.0-CURRENT).

Second, please remove the KVM and attach your PS/2 mouse directly to
your FreeBSD box.  It is well known that some KVMs are not so
compatible.  Give `boot -v' at the boot loader prompt to obtain
verbose boot message and send me /var/run/dmesg.out.

Third, when you use the KVM and boot the FreeBSD box, make sure the
KVM is switched to the FreeBSD box so that the FreeBSD kernel can have
"direct" access to the PS/2 mouse.  The PS/2 mouse driver would like
to set up your PS/2 mouse during boot, and needs to receive response
from the mouse during this set up process.  Again start the system
by giving `boot -v' at the boot loader prompt to obtain
verbose boot message and send me /var/run/dmesg.out.

When you installed 4.0-RELEASE on this system, were you using the KVM?

Kazu
Comment 3 sparhawk 2000-03-30 13:17:17 UTC
----- Original Message -----
From: "Kazutaka YOKOTA" <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To: <sparhawk@enteract.com>
Cc: <freebsd-gnats-submit@freebsd.org>;
<yokota@zodiac.mech.utsunomiya-u.ac.jp>
Sent: Thursday, March 30, 2000 1:15 AM
Subject: Re: misc/17610: mouse does not work after compiling 4.0-stable


>
> >>Number:         17610
> >>Category:       misc
> >>Synopsis:       mouse does not work after compiling 4.0-stable
> [...]
> >>Originator:     David Foresman
> >>Release:        4.0-release
> >>Organization:
> >n/a
> >>Environment:
> >FreeBSD sparhawk.ce.mediaone.net 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Sun
Mar 2
> >6 15:25:02 CST 2000
root@sparhawk.ce.mediaone.net:/usr/src/sys/compile/SPA
> >RHAWK  i386
> >
> >>Description:
> >I have a ps/2 intellimouse pluged into a kvm switch. During install and
setup
> >of 4.0-release the mouse works fine.  Using 4.0-release, the mouse works
fine.
> >  If I cvsup to 4.0-stable or 5.0-current, the mouse no longer works.
> >
> >I have moused="yes" in rc.conf, the moused commandline looks like this.
> >moused -p /dev/psm0 -t auto.
> >
> >I have tried auto, ps/2 and intellimouse as the type.
> >
> >The mouse also doesn't work under X.
> >>How-To-Repeat:
> >Plug mouse into kvm and upgrade to 4.0-stable.
>
> We need to verify several things.
>
> First, is your kernel and userland in sync?  You need to do `make
> world' and rebuild the kernel after cvsupping RELENG_4 or HEAD
> (5.0-CURRENT).
>

I did try a make world on one of the builds.  I removed /dev/* and did a
MAKEDEV all after make world thinking it was a problem with /dev/psm0

> Second, please remove the KVM and attach your PS/2 mouse directly to
> your FreeBSD box.  It is well known that some KVMs are not so
> compatible.  Give `boot -v' at the boot loader prompt to obtain
> verbose boot message and send me /var/run/dmesg.out.

I'll try this tonight.  But why would it work under 4.0-r and not 4.0-s.

>
> Third, when you use the KVM and boot the FreeBSD box, make sure the
> KVM is switched to the FreeBSD box so that the FreeBSD kernel can have
> "direct" access to the PS/2 mouse.  The PS/2 mouse driver would like
> to set up your PS/2 mouse during boot, and needs to receive response
> from the mouse during this set up process.  Again start the system
> by giving `boot -v' at the boot loader prompt to obtain
> verbose boot message and send me /var/run/dmesg.out.
I have booted fbsd with the kvm on that computer the whole time.

>
> When you installed 4.0-RELEASE on this system, were you using the KVM?

Yes, the kvm has been plugged in the entire time.  the KVM was plugged in
and working during the install.  I even switch screens to my other computer
several times during the install.
>
> Kazu
>
>
>

I have fbsd, linux-mandrake, win98 and win2k all on this machine.  I don't
mind reinstalling the OS if i can figure out what's wrong.
Comment 4 yokota 2000-03-30 15:02:04 UTC
>> We need to verify several things.
>>
>> First, is your kernel and userland in sync?  You need to do `make
>> world' and rebuild the kernel after cvsupping RELENG_4 or HEAD
>> (5.0-CURRENT).
>
>I did try a make world on one of the builds.  I removed /dev/* and did a
>MAKEDEV all after make world thinking it was a problem with /dev/psm0

Ok, so you have done `make world' and recompiled a new kernel.

>> Second, please remove the KVM and attach your PS/2 mouse directly to
>> your FreeBSD box.  It is well known that some KVMs are not so
>> compatible.  Give `boot -v' at the boot loader prompt to obtain
>> verbose boot message and send me /var/run/dmesg.out.
>
>I'll try this tonight.  But why would it work under 4.0-r and not 4.0-s.

After 4.0 was released, the psm driver was updated to add support for
more mice, including MS IntelliMouse Explorer (yes, IntelliMouse
and IntelliMouse Explorer are so much different).

This update slightly changed the mouse probe sequence and there is a
chance that your KVM may be got confused by the new probe sequence.
The genuine IntelliMouse, and other mice, do work properly with the
updated driver (I tested them before I commit the new code :-)

As I wrote before, some KVM products claim they are compatible with,
or "is able to emulate", MS IntelliMouse even when in fact they are
not exactly compatible.

>> Third, when you use the KVM and boot the FreeBSD box, make sure the
>> KVM is switched to the FreeBSD box so that the FreeBSD kernel can have
>> "direct" access to the PS/2 mouse.  The PS/2 mouse driver would like
>> to set up your PS/2 mouse during boot, and needs to receive response
>> from the mouse during this set up process.  Again start the system
>> by giving `boot -v' at the boot loader prompt to obtain
>> verbose boot message and send me /var/run/dmesg.out.
>I have booted fbsd with the kvm on that computer the whole time.

Please provide demsg.out so that I can diagnose the response from
the mouse via your KVM.

>> When you installed 4.0-RELEASE on this system, were you using the KVM?
>
>Yes, the kvm has been plugged in the entire time.  the KVM was plugged in
>and working during the install.  I even switch screens to my other computer
>several times during the install.

Once the kernel is loaded and the system gets working, you can safely
switch screens via the KVM.  But, you had better let the FreeBSD box
see the mouse directly while the FreeBSD kernel is starting.  (If the
KVM is VERY clever and compatible, you may even switch away from the
FreeBSD box while the kernel is booting...)

Kazu
Comment 5 sparhawk 2000-03-31 14:29:51 UTC
Ok, I tried with 4.0-r, 4.0-s, and with the mouse off the kvm.

4.0-R works.

psm: status 00 02 64
psm: status 00 00 64
psm: status 00 03 64
psm: status 00 03 64
psm: status 00 00 64
psm: data ffffffff 00 64
psm: data ffffffff 02 64
psm0: failed to get data.
psm: status 00 02 64
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3-00, 3 buttons
psm0: config:00000000, flags:00000000, packet size:4
psm0: syncmask:00, syncbits:00

4.0-s does not work.

psm: status 00 02 64
psm: status 00 00 64
psm: status 00 03 64
psm: status 00 03 64
psm: data ffffffff 03 64
psm: data ffffffff 02 64
psm0: failed to get data.
psm: status 00 02 64
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse Explorer, device ID 4-00, 5 buttons
psm0: config:00000000, flags:00000000, packet size:4
psm0: syncmask:00, syncbits:00

4.0-s with the mouse off the kvm works.

psm: status 00 02 64
psm: status 00 00 64
psm: status 00 03 64
psm: status 00 03 64
psm: data 08 00 00
psm: data 08 00 00
psm: status 00 02 64
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse Explorer, device ID 4-00, 5 buttons
psm0: config:00000000, flags:00000000, packet size:4
psm0: syncmask:08, syncbits:08


This mouse is an intellimouse explorer.  So what ever code you used to
detect the intellimouse explorer, is confusing my kvm becuase it only knows
about regular intellimouse's.

Is there any way i can force the detect to regular intellimouse?.

I'm attaching all 3 dmesg.boot to this message.
Comment 6 yokota freebsd_committer freebsd_triage 2000-04-02 09:29:04 UTC
State Changed
From-To: open->closed

Fixed in /sys/isa/psm.c rev 1.25.