From: Brad.Hards@dao.defence.gov.au To: linux-usb@suse.com Date: Tue, 8 Jun 1999 08:47:46 +1000 Subject: [linux-usb] HOW-TO USB 0.3 [15K] I have reorganised the HOWTO, guessed at a few things, and built it up. This is mostly a "send corrections" version (odd number minor version). Probably better not archived. Please send me corrections for printer, acm, and cpia since I don't have those, and I just guessed how it might work. I will fix the X - mouse problem in the next version, after I get it the wheel stuff incorporated and try out my second mouse. (See attached file: HOWTO-usb-0.3.tar.gz) _______________________________________________ How to get USB devices working under Linux Brad Hards $Revision: 0.3 $ This document is an early draft a step-by-step guide to getting USB devices working on a linux system _________________________________________________________________ Basic USB Configuration You need a late version kernel. Kernel versions 2.2.7 and later contain the USB code. You really need to be running the current 2.3.x kernel, ideally with any pre-patches for the next kernel. USB code is in fairly early development, so the changes between each version (and the bugs) tend to change fairly fast. Support on the mailing list linux-usb@suse.com for anything except the lastest version is scant at best. You need to configure USB into your kernel. Use of make menuconfig is recommended. Under USB drivers - not for the faint of heart , you need to select Support for USB (EXPERIMENTAL!) . You also need to select one of UHCI (intel PIIX4 and others) support, OHCI (compaq and some others) support or OHCI-HCD (other OHCI opt. Virt. Root Hub) support. Use of more than one of UHCI, OHCI, and OHCI-HCD at the same time is not expected to fully work (UHCI might work). Which one you select is dependent on what kind of motherboard or adapter you have. Intel and Via motherboards are UHCI. Compaq and NEC motherboards, iMacs and any adapter using Opti chips (just about all of them) are OHCI, and you can use OHCI or OHCI-HCD, at your option. If you do not know what kind of controller to choose, check your motherboard documentation or look at /proc/pci for a hint. Failing that, just try one. You also need to select whichever devices you want to use, for example USB mouse support for a USB mouse, USB keyboard support for a USB keyboard, USB hub support for a hub, USB Abstract Control Model support for a POTS or ISDN modem, and Preliminary USB Printer support for a USB printer. You should be able to use modules or split modules and kernel code. Rebuild the kernel and the modules (if you configured to build as modules), and install the new kernel and the new modules. Reboot the system. You need to install usb modules with modprobe usb-uhci , modprobe usb-ohci or modprobe usb-ohci-hcd if you elected to build as modules. Inspect the kernel logs. You should see lines like the following (assuming use of OHCI-HCD) May 14 09:29:41 rachel kernel: USB HID boot protocol mouse registered. .... May 14 09:29:41 rachel kernel: usb_hub_thread at c01b68ec May 14 09:29:41 rachel kernel: ohci_roothub_thread at c01b523c .... May 14 09:29:41 rachel kernel: USB mouse found UHCI and OHCI should give similar results. You may also see lines about hub configuration (if you have one) and descriptors. Don't worry about failing transfers, this is a minor bug that shouldn't affect anything. If there isn't anything that could be USB related (lines that mention hubs, usb, ohci or uhci), likely causes are use of the wrong driver (UHCI when you needed OHCI or OHCI when you needed UHCI), not physically installing the hardware, a BIOS configuration that disables USB or stuffing up the configuration or installation of the kernel. _________________________________________________________________ Mouse Configuration Firstly check that your mouse is being correctly sensed by the kernel. If you type more /proc/interrupts , you should see a line that refers to USB - typically ohci-usb or usb . If you click the mouse a few times, and then have a look at /proc/interrupts the count associated should increase (by two per click, one for down and one for up). This may not work reliably if you have other devices connected, notably a keyboard. You need to set up a /dev entry for the mouse. Use the following command: mknod /dev/usbmouse c 10 32 Check /proc/misc. You should see something like [bradh@rachel bradh]$ more /proc/misc 32 USB Mouse 1 psaux If you want to use the mouse under X, you need to: * edit the XF86Config file (usually /usr/X11R6/lib/X11/XF86Config). Add the following (anywhere sensible, ideally in the Input devices area). Section "Xinput" SubSection "Mouse" DeviceName "USB Mouse" Protocol "PS/2" Port "/dev/usbmouse" AlwaysCore EndSubSection EndSection * Restart the X server. If you don't have any mouse support at this point, remember that Ctrl-Alt-1 will get you a virtual terminal that you can use to kill the xserver and start debugging from the error messages If you want to use the mouse under gpm, run gpm -m /dev/usbmouse -t ps2 (as superuser remember). You can make this the default if you edit the rc.d file(s) in /etc/rc.d/ _________________________________________________________________ Keyboard Configuration You may not need any operating system support at all to use a USB keyboard. There are several BIOSs available where the BIOS can provide USB support from a keyboard plugged into the root hub on the motherboard. This is not expected to work though other hubs or on add-in boards, so you might want to add in support anyway. Check that your keyboard is being correctly sensed by the kernel. If you type more /proc/interrupts , you should see a line that refers to USB - typically ohci-usb or usb . If you type on the keyboards and then have a look at /proc/interrupts the count associated should increase. At this point, you should be able to use your USB keyboard just as for a normal keyboard. Be aware that LILO is not USB aware, and that unless your BIOS supports a USB keyboard, you may not be able to select a non-default boot image using the USB keyboard. _________________________________________________________________ Hub Support Hubs should work without other configuration. _________________________________________________________________ Printer Support You need to set up a /dev entry for the printer. Use the following command: mknod /dev/usblp c 254 0 You should now be able to use this device in a normal /etc/printcap entry. I recommend use of automated tools to generate such files, such as RedHat's control panel print-tool. _________________________________________________________________ Abstract Control Model Support You need to set up a /dev entry for the ACM device. Use the following command: mknod /dev/usbacm c 10 32 You should now be able to use a terminal emulator program to attach to this /dev/usbacm and connect to your modem or other terminal device. _________________________________________________________________ CPiA imager support Support for CPiA cameras is included in the normal distribution, but is not included in the normal Config.in in the linux/drivers/usb directory. You need to add a line like dep_tristate 'USB CPiA camera support' CONFIG_USB_CPIA $CONFIG_USB into this Config.in. Now reconfigure your kernel to support this device and also enable Video For Linux support (under Character Devices if using menuconfig. You need to set up a /dev entry for the CPiA camera. Use the following command: mknod /dev/usbacm c 81 0 _________________________________________________________________ Corrections Please send comments on this document to the author, preferably by E-Mail (<[1]brad.hards@dao.defence.gov.au>), including the version number: ($Revision: 0.1 $). References 1. mailto:brad.hards@dao.defence.gov.au