-   Debian (
-   -   PS/2 and USB mouse with Kernel 2.6 (

kushalkoolwal 08-31-2005 03:46 PM

PS/2 and USB mouse with Kernel 2.6

My problem is a little complicated(may or may not be but for now it seems so). I will explain it in some detail.

Situation 1:
My Debian system (stable) was running fine with 2.6.8-2-386 kernel version. I mean the PS/2 mouse was working fine and I was able to boot into X Windows. At that time in my BIOS, I had disabled the 'USB booting and Legacy' option. Everything worked fine.
My Xorg.conf file looked like:

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
# If you have edited this file but would like it to be automatically updated
# again, run the following commands:
#  cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
#  sudo sh -c 'md5sum /etc/X11/xorg.conf >/var/lib/xfree86/xorg.conf.md5sum'
#  sudo dpkg-reconfigure xserver-xorg

Section "Files"
        FontPath        "unix/:7100"                        # local font server
        # if the local font server has problems, we can fall back on these
        FontPath        "/usr/lib/X11/fonts/misc"
        FontPath        "/usr/lib/X11/fonts/cyrillic"
        FontPath        "/usr/lib/X11/fonts/100dpi/:unscaled"
        FontPath        "/usr/lib/X11/fonts/75dpi/:unscaled"
        FontPath        "/usr/lib/X11/fonts/Type1"
        FontPath        "/usr/lib/X11/fonts/CID"
        FontPath        "/usr/lib/X11/fonts/100dpi"
        FontPath        "/usr/lib/X11/fonts/75dpi"
        # paths to defoma fonts
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"

Section "Module"
        Load        "GLcore"
        Load        "bitmap"
        Load        "dbe"
        Load        "ddc"
        Load        "dri"
        Load        "extmod"
        Load        "freetype"
        Load        "glx"
        Load        "int10"
        Load        "record"
        Load        "type1"
        Load        "v4l"
        Load        "vbe"

Section "InputDevice"
        Identifier        "Generic Keyboard"
        Driver                "keyboard"
        Option                "CoreKeyboard"
        Option                "XkbRules"        "xorg"
        Option                "XkbModel"        "pc104"
        Option                "XkbLayout"        "us"

Section "InputDevice"
        Identifier        "Configured Mouse"
        Driver                "mouse"
        Option                "CorePointer"
        Option                "Device"                "/dev/input/mice"
        Option                "Protocol"                "ImPS/2"
        Option                "Emulate3Buttons"        "true"
        Option                "ZAxisMapping"                "4 5"
Section "InputDevice"
        Identifier        "Generic Mouse"
        Driver                "mouse"
        Option                "SendCoreEvents"        "true"
        Option                "Device"                "/dev/psaux"
        Option                "Protocol"                "PS/2"
        Option                "Emulate3Buttons"        "true"
        Option                "ZAxisMapping"                "4 5"

Section "Device"
        Identifier        "Intel Corporation 82852/855GM Integrated Graphics Device"
        Driver                "i810"
        BusID                "PCI:0:2:0"
        VideoRam        8192
        Option                "UseFBDev"                "true"

Section "Monitor"
        Identifier        "Generic Monitor"
        Option                "DPMS"
        HorizSync        28-50
        VertRefresh        43-75

Section "Screen"
        Identifier        "Default Screen"
        Device                "Intel Corporation 82852/855GM Integrated Graphics Device"
        Monitor                "Generic Monitor"
        DefaultDepth        24
        SubSection "Display"
                Depth                1
                Modes                "1024x768" "800x600" "640x480"
        SubSection "Display"
                Depth                4
                Modes                "1024x768" "800x600" "640x480"
        SubSection "Display"
                Depth                8
                Modes                "1024x768" "800x600" "640x480"
        SubSection "Display"
                Depth                15
                Modes                "1024x768" "800x600" "640x480"
        SubSection "Display"
                Depth                16
                Modes                "1024x768" "800x600" "640x480"
        SubSection "Display"
                Depth                24
                Modes                "1024x768" "800x600" "640x480"

Section "ServerLayout"
        Identifier        "Default Layout"
        Screen                "Default Screen"
        InputDevice        "Generic Keyboard"
        InputDevice        "Configured Mouse"
        InputDevice        "Generic Mouse"

Section "DRI"
        Mode        0666

Situation 2:
Now for some reason I realized that I will have to enable the ''USB booting and Legacy' as in future I would want to boot through USB device also. Basically this option simulates the USB keyborad and Mouse as PS/2 keyboard and mouse. As soon as I enable this option, my X-windows won;t start and it says cannot find core pointer and takes me to the text mode after disableing the X session.

Situation 3:
Then I found that the mandrake LE 2005 version would just work fine with that 'USB legacy.." option enabled. My mouse worked and I was able to go into Graphical mode. The kernel version was 2.6.11-6. So I downloaded the linux kernel source and copied the config file of Mandrake on to my Debian system and compiled the kernel with the same configuration with which mandrake was working fine.

When I booted my debian system with mandrake compiled kernel and the 'USB...' option enabled in the BIOS, I was able to go to into the X-windows system but my mouse won;t work. My keyboard worked fine. So basically everything was fine except that my system won;t work with the PS/2 mouse. Then I attached the USB mouse to my system and the USB mouse worked fine but my PS/2 won't work. The Xorg.conf file is same as the one above posted,

I visited a couple of discussion in this forrum to get my PS/2 mouse working with the 'USB booting and legacy option enabled' as below but they did not worked for me:

Then I installed the program gpm and mdetect. They seemed to work fine but still my PS/2 mouse won;t work in X-windows system.

One interesting observation was that with Debian Kernel 2.4 everything is working fine. PS/2 mouse works. But for that I had to make the following change in my xorg.conf file:
I removed the Generic Mouse section and made the following changes so now I had only one mouse section as compared to two in kernel 2.6

Section "InputDevice"
        Identifier        "Configured Mouse"
        Driver                "mouse"
        Option                "CorePointer"
        Option                "Device"                "/dev/psaux"
        Option                "Protocol"                "ImPS/2"
        Option                "Emulate3Buttons"        "true"
        Option                "ZAxisMapping"                "4 5"

I have heard that there was been some major changes in PS/2 mouse configuration in upgrading from kernel 2.4 to 2.6 as referred by this article:

Let me know if you guys need any more information(like lspci or ls of some directory). I will be glad to post it.

So the bottom line is How can I get my PS/2 mouse working in Debian Kernel 2.6 with "USB booting and Legacy option' enabled.

Thank you for the patience.

Matir 08-31-2005 04:57 PM

Have you checked that your mouse is actually being detected on /dev/psaux or /dev/input/mice? If you're running gpm, does it work with the mouse? If so, you should probably be activating gpm's repeat mode and using /dev/gpmdata for the device.

kushalkoolwal 08-31-2005 05:17 PM

Yes the mouse is detected on /dev/psaux and /dev/input/mice. This is because my USB mouse works fine when attached but PS/2 mouse does not work.

When i do:

cat /dev/psaux


cat /dev/input/mice

and when I move the USB mouse I get garbled characters on the screen which means both the devices are attached with the USB mouse.

Any thoughts?

kushalkoolwal 08-31-2005 05:19 PM


Originally posted by Matir
Have you checked that your mouse is actually being detected on /dev/psaux or /dev/input/mice? If you're running gpm, does it work with the mouse? If so, you should probably be activating gpm's repeat mode and using /dev/gpmdata for the device.
Also how do I activate gpm's repeat mode and use /dev/gpmdata?

Matir 08-31-2005 05:30 PM

man gpm(8):

Causes gpm to act as a repeater: any mouse data received while
in graphic mode will be produced on the fifo /dev/gpmdata in
protocol name, given as an optional argument (no space in
between !). In principle, you can use the same names as for the
-t option, although repeating into some protocols may not be
implemented for a while. In addition, you can specify raw as
the name, to repeat the mouse data byte by byte, without any
protocol translation. If name is omitted, it defaults to msc.
Using gpm in repeater mode, you can configure the X server to
use its fifo as a mouse device. This option is useful for bus-
mouse owners to override the single-open limitation. It is also
an easy way to manage those stupid dual-mode mice which force
you to keep the middle button down while changing video mode.
The option is forced on by the -M option.
Then just place /dev/gpmdata in the place of /dev/input/mice or /dev/psaux in your X config.

kushalkoolwal 08-31-2005 06:42 PM

I tried what you suggested, but the behaviour remains the same. Is there any way by which I can find if there is any data generated on the PS/2 port. There has to be something with the Debian settings which requires tweaking because as I said earlier it works fine with Mandrake 10.2(LE 2005).

Any one has any idea?

farpoint 09-01-2005 09:55 AM

I had problems with the 2.6 kernel and the mouse. I admit I have no usb mouse, just a PS2 one. First problem where X would not start at all was fixed by Modprobe mousedev. Then X would start but the mouse pointer was frozen. Modprobe psmouse fixed this and all has been ok since then. If by some chance this does work. Add psmouse on a separate line in /etc/modules. Nigel. aka farpoint.

kushalkoolwal 09-01-2005 11:56 AM

I have tried loading the mousedev mopdule also but my PS/2 would just freeze if I enable t he 'USB booting and Legacy' ooption. I don;t blame the BISO for this because RedHat, Fedora and Mandrake(all are the derivatives of RedHat) all seems to work fine in this situation as I said before.

Still need some help. Does anyone know how Fedora and Debian are different while talking to the PS/2 mouse? I mean do they directly talk to the Hardware device or they depend upon the BIOS to talk to the Hardware.

Matir 09-01-2005 12:43 PM

Hrrm... with gpm running, the mouse works in the console?

kushalkoolwal 09-01-2005 12:57 PM

Yes the USB mouse works fine in text mode console and in GNOME also. But when only PS/2 mouse is attached the pointer just freezes on the screen although my keyboard works fine? Also somebody suggested me to load the usb driver/module first and then the psmouse module while booting. How can I do that? Do I have to add something in /etc/rc.S/ directory.

Please help me.

Matir 09-01-2005 01:04 PM

If you are trying to fix the PS/2 mouse, why would you need the usb driver? :)

Also, does the PS/2 mouse work in the console with GPM? If not, the problem is kernel-level. If so, the problem is with X.

kushalkoolwal 09-01-2005 02:14 PM

thanks for looking into my mysterious problem.

Well, actually, I want that the users should be able to use both the mouse, which ever they prefer : PS/2 and USB.

No my PS/2 mouse does not work with GPM nor without GPM. It does not work at all. The system works fine with USB mouse.

And as I told before the Mandrake and Fedora works fine i.e PS/2 mouse and USB mouse both work. How can I compare the mouse settings of the two system(debian and Mandrake/Fedora) at the kernel level. What parameters do I need to inspect. I am compling psmouse as a module right now.

Also does anyone knows about the how we change the order in which the kernel loads the modules?

Matir 09-01-2005 02:34 PM

Look in the kernel config files to compare the kernel setups. However, virtually all kernels should have psmouse support. Have you tried 'dmesg | grep -i mouse'?

kushalkoolwal 09-01-2005 03:12 PM

I took the .config file from the Mandrake(kerenel version 2.6.11-6-upGB) and compiled the Linux kernel on debian with it. I downloaded the linux-2.6.11 source code from But nothing helped much. The situation remains the same.

Here is the output of the command that you had asked:


debian:~# dmesg | grep -i mouse
input: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:1d.0-2
mice: PS/2 mouse device common for all mice

rednuht 09-01-2005 05:42 PM

what is the ouput of (as root)

All times are GMT -5. The time now is 09:07 AM.