From owner-freebsd-current Sun Aug 12 1: 4: 6 2001 Delivered-To: freebsd-current@freebsd.org Received: from nasu.utsunomiya-u.ac.jp (nasu.utsunomiya-u.ac.jp [160.12.128.3]) by hub.freebsd.org (Postfix) with ESMTP id DEA3137B40B for ; Sun, 12 Aug 2001 01:03:59 -0700 (PDT) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from nantai.utsunomiya-u.ac.jp by nasu.utsunomiya-u.ac.jp (8.11.2/1.1.29.3/26Jan01-1134AM) id f7C83wc225982; Sun, 12 Aug 2001 17:03:58 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp by nantai.utsunomiya-u.ac.jp (8.11.2/1.1.29.3/30Jan01-0241PM) id f7C83wK462032; Sun, 12 Aug 2001 17:03:58 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:6LnFdZ/xdT4KBASsbAVP9NiU5z00KZud@zodiac.mech.utsunomiya-u.ac.jp [160.12.43.7]) by zodiac.mech.utsunomiya-u.ac.jp (8.9.3+3.2W/3.7W/zodiac-May2000) with ESMTP id RAA26578; Sun, 12 Aug 2001 17:13:37 +0900 (JST) Message-Id: <200108120813.RAA26578@zodiac.mech.utsunomiya-u.ac.jp> To: current@freebsd.org Cc: yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: FreeBSD's aggressive keyboard probe/attach Date: Sun, 12 Aug 2001 17:13:36 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Oh, no, another blow up while I was asleep... To be honest, as someone who has tried to maintain the keyboard and PS/2 mouse drivers in FreeBSD (and the mouse driver in XFree86) for more than 4 years, I must say I am rather disappointed. I DID write many man pages and FAQ entries for keyboard/mouse support, answered many questions in FreeBSD MLs, fixed many PRs, and helped people to solve their problems, and fixed drivers. I DID what I could! I feel shot down. As I am going away few days for business trip and must do some preparation for that today, I don't have time to discuss all the details raised in this thread. But, I think I should leave few quick notes. .... Some of you may be thinking that it is not hard to make the psm driver work in all situations. My experience tells otherwise. How many mice do you know I have here to test with? I own variety of nearly 100 mice from various vendors, famous and no-name. Many are well behaved in the sense that they are compatible with each other regarding extra features. There are some that are not compatible with the others. It is possible to make the driver "almost" always work with these mice; we treat all of them as a plain 2 button mouse. It is the greatest common measure (no 3rd button, no wheel, no advanced features). Things break when you have a KVM and another OS put the mouse in enhanced or advanced state to utilize extra buttons and wheels. And people certainly want his/her mouse's 3rd, 4th, 5th buttons and wheel work. Linux PS/2 mouse driver knows almost nothing about the mouse protocol and mouse state. (Well, it knows about the standard 2-button mouse, IntelliMouse, and Genius mouse.) It leaves all the chore to the user-land program such as the X server to do initialization and set-up of the mouse. (I believe Solaris, Net/OpenBSD and many other UN*X variants are doing the same.) A few years ago, it was decided that hardware initialization should be device driver's business and the user-land program shouldn't be bothered with it. With moused(8), psm(4), mse(4), ums(4), sysmouse(4), we can handle any mouse, PS/2, bus, serial, or usb, in the same way, via sysmouse(4) (its protocol is described in mouse(4)). This way, the user just specify /dev/sysmouse as the mouse port and "sysmouse" as the protocol in his/her XF86Config and doesn't need to experiment with various mouse protocols to find which one works with his/her mouse in X. .... I am fully aware that some of you have problems with your PS/2 mouse, particularly when used with a KVM switch. Don't say "other OSes always work". If two OSes on your KVM try to put the PS/2 mouse in different operating modes, both of them have the out-of-sync problem when you switch between the two. Both OSes work only if they use the mouse in the same mode. Linux mouse driver certainly doesn't automatically correct this situation; it doesn't even know the problem exists. If your mouse goes south in XFree86 on Linux, you need to restart the X server or switch to another vty and get back to the X session to get the mouse pointer right. This "almost" works, as the XFree86 on Linux sends initialization commands to the mouse when it is coming to foreground, but it doesn't fully reset the mouse, thus, there are cases it won't work. The equivalent technique in FreeBSD is to send HUP to moused(8). As for flags 0x8000 for the psm driver, I added it as an option in -CURRENT to test if it works for those who are seeing the "out of sync" problem. Maybe I have not advertised it enough to get responses, and we should make it default now. .... Please also remember that there are many different KVM switches in the market. You just cannot expect they work in the same way. There isn't a single standard way for the firmware of the electrical KVM switch to handle mouse packets. Some vendors claims their switch "emulates" a certain mouse, only that the emulation is not complete. .... As for "poor" documentation, don't expect authoritative hardware specification for PS/2 mice. There isn't such thing. IBM's first PS/2 mouse protocol (plain 2 button) is well known. But, other mice's protocols are not publicly available. Logitech used to send you their mouse's technical manual upon request. It seems they stopped distributing it these days. MS certainly doesn't disclose any information on their IntelliMouse series products. I did try to obtain technical information from a few other vendors too; no one was forthcoming. For the last few years, I have struggled to figure out the contents of packets sent by various mice. No, I have not published a manual or notes (other than code itself and CVS logs) to describe what I have found. I know I should do that. I simply haven't had time. Don't accuse me of being lazy. It's volunteer project! People do what s/he can do in his/her spare time! Kazu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message