Subject: Re: PS/2 mice.
To: <>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 11/27/2002 22:31:10
On Wed, Nov 27, 2002 at 03:28:14PM -0600, Richard Rauch wrote:
> I don't know if this is applicable to other ports (are PS/2 connectors
> peculiar to the PC world?).  I suspect that it only applies to i386's, so
> I'm posting here.

They appear elsewhere, some sun (and clone) sparc systems have them
(because they have a PCI bus and a PC southbridge...)
The SA1101 strongarm companion chip has 2 ps/2 interfaces.

> Is it a bug or the nature of the beast that a PS/2 mouse plugged into a
> keyboard PS/2 connector *prevents* the OS from booting?  (It gets up to
> the point of loading the kernel and turning on the "soft" block cursor,
> then freezes.)  The last actual message is the one you get from seeing the
> kernel image loaded from disk, with the cursor scrolled down to the next
> (still blank) line.

I'm surprised you get that far, many PC BIOS refuse to play if the
keyboard isn't connected.
(oh you have a USB keyboard and a ps2 mouse....)

> This is NetBSD 1.6/i386.  It's a very vanilla installation (I was doing
> some experiements and wiped the disk doing a fresh install; absolutely
> generic kernel).
> 
> I don't remember this happening under previous OS's.  I'm sure I've
> swapped the connectors at least once in the past, since the labeling on
> this machine is a little unclear.  I thought that in the past it just came
> up without a working keyboard/mouse.  (Or maybe one worked but the other
> did not?)
> 
> Is the hardware *really* different, or is it just a convention?  Could the
> OS probe the port and try to figure out which is connected?

The hardware is identical, with careful coding it is possible to
determine whether you have a keyboard or mouse from the responses
to the ps2 reset sequence.
My driver for the SA1101 would support 2 keyboards or 2 mice
(got more confusing because the system also had a touch scree that
might be showing a virtual keyboard, oh and you could plug in a
serial mouse...)

> Is this something worth filing a PR on, or should I just forget about it?
> (Up until NetBSD tries to boot, there is *NO* evidence of any problem
> (the keyboard is on a UXB port, so there's no chance to notice a dead
> keyboard).  Since I was fooling with the hardware a bit, I was afraid that
> I'd damaged some motherboard hardware, at first.  A crack in a trace, say.
> Unplugging the mouse was a "welllll....*maybe* this will make a
> difference" last resort kind of thing; (^&.  BIOS didn't mind, the
> bootloader didn't mind...but NetBSD wouldn't boot.  Seems like a sneaky
> way to render a computer inoperable: Plug in a mouse on the keyboard
> connector and wait for the next system reboot...)

The bios is probably using the 'legacy' device support of the
usb chipset - IIRC that makes the usb chip respond to the standard
ps2 io ports.
How this interracts with the mouse and netbsd's usb stack is anybodies
guess!

	David

-- 
David Laight: david@l8s.co.uk