The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
USB Mouse support under 4.0 Release 20 March 2000
Need more help on this topic? Click here
This article has no comments
Show me similar articles
Benn Bollay originally placed this article in the Reader Forum, but I thought it deserved an article of its own.  Thanks Benn.
4.0-R: Quick and Dirty USB Mouse support
Gentlebeings --

For your quick and dirty USB Mouse support, please following these easy steps:

  1. Add the appropriate entries to your kernel configuration file:

    device uhci
    device ohci
    device usb
    device ums
  2. Add the appropriate lines to your /etc/rc.conf file:

    moused_enable="NO"
    moused_flags="/dev/ums0"
    usbd_enable="YES"
    usbd_flags=""
    (though I like -vv personally, just for the scroll factor)
  3. Make sure your /etc/usbd.conf has these lines in it:

    device "Mouse"
    devname "ums[0-9]+"
    attach "/usr/sbin/moused -p /dev/${DEVNAME} -I
                   /var/run/moused.${DEVNAME}.pid"

  4. Create the device entry

    cd /dev
    ./MAKEDEV ums0
  5. Rebuild your kernel and reboot.  As always, I would recommend saving /kernel to /kernel.stable before trying out the new kernel.  It's a handy thing to have around anyways.
  6. Add the following line to /etc/rc.conf which enables the mouse on all virtual terminals:

    allscreens_flags="-m on"

I don't think I forgot anything, but if I did please let me know :)

-- Benn

References and man pages
Benn recommends the following man pages:
  • usb(4)
  • usbd(8)
  • usbd.conf(5)
  • usbdevs(8)
  • ums(4)

If you have X11 pointed at sysmouse, then this will work just fine.  And it will support plugging/unplugging the mouse at runtime without the need of a manual HUP.

Addenda
You have to do this:

vidcontrol -m on

to actually enable it on the terminal.  Alexander Anderson said he found this piece of info on the man page for moused(8) by accident.  He also suggested step 6 above.


Need more help on this topic? Click here
This article has no comments
Show me similar articles