%% $Header: /cvsroot/lcdp/lpic/general-linux-1/slides/gl1.101.7.slides.tex,v 1.3 2003/05/29 14:10:18 geoffr Exp $ \input{gl1.slide-header.tex} \usepackage{epsfig} %\overlaysfalse %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80-> \begin{slide} %================================================================ \begin{center} \LARGE \textsf{-- General Linux 1 -- \\ Set Up USB devices [2]} \\[2mm] \large \textsf{(Linux Professional Institute Certification)}\\[1mm] \normalsize\end{center} \footnote{Copyright \copyright\ 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation---either version 2 of the License or (at your option) any later version.} \scriptsize \begin{verbatim} .~. Prepared by: Andrew Eager /V\ // \\ geoffrey robertson @._.@ geoffrey@zip.com.au \end{verbatim} \tiny \begin{verbatim} $Id: gl1.101.7.slides.tex,v 1.3 2003/05/29 14:10:18 geoffr Exp $ \end{verbatim} \normalsize \vfill \end{slide} %----------------------------------------------------------- %----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80-> %============================================================================== \begin{slide}{} %ghr \Slidecontents \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide} %ghr \slideheading{Set Up USB devices [2]} \slidesubheading{(1.1) 101 Hardware \& Architecture [11]} \begin{description} \item[1.101.1] Configure BIOS Fundamental Settings [3] \item[1.101.3] Configure Modem and Sound cards [2] \item[1.101.4] Setup SCSI devices [2] \item[1.101.5] Setup different PC expansion cards [2] \item[1.101.6] Configure Communication Devices [2] \item[1.101.7] {\bf \underline{Set Up USB Devices [2]}} \end{description} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide} %ghr \Slideheading{Set Up USB devices [2] } \slidesubheading{Objective} Candidates should be able to activate USB support, use and configure different USB devices. This objective includes the correct selection of the USB chipset and the corresponding module. It also includes the knowledge of the basic architecture of the layer model of USB as well as the different modules used in the different layers. \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide} %ghr \Slideheading{Set Up USB devices [2]} \slidesubheading{Key files, terms, and utilities} \begin{alltt} lspci(8) usb-uhci.o usb-ohci.o /etc/usbmgr/ usbmodules /etc/hotplug \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide} %ghr \Slideheading{Set Up USB devices [2]} \slidesubheading{Resources of interest} \begin{description} \item[The Linux-USB Project]: \begin{alltt} http://www.linux-usb.org: \end{alltt} \item[The Linux USB Sub System]: by Brad Hards, Sigma Bravo Pty Ltd \end{description} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \slideheading{The Universal Serial Bus} \begin{itemize} \overlay{1} \item A serial transmission scheme \overlay{2} \item Two versions of USB Version 1 \& Version 2 \overlay{3} \item Version 1 \begin{itemize} \item released January 1996 \item supports speeds up to 12MBit/s (8.5Mbit/s in practice) \item supports up to 127 devices connected to the bus \end{itemize} \overlay{4} \item Version 2: \begin{itemize} \item announced 1999 \item supports speeds up to 480Mbit/s \end{itemize} \overlay{5} \item Devices can be self or bus powered \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \slideheading{USB Topology} \slidesubheading{} The system unit contains the host controller and one virtual root hub with at least one (and normally two) USB interfaces. These interfaces can then be connected directly to a USB device or to another HUB. \fbox{\epsfig{file=../images/topo.eps,width=.7\textwidth}} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \slideheading{USB Device Driver Layers} \slidesubheading{} The Device drivers for the USB sub-system are split into two distinct layers: \begin{description} \item[Hardware Layer] usbcore \& usb-uhci / usb-ohci \item[API Layer] - Application / Product specific \end{description} \fbox{\epsfig{file=../images/api.eps,width=.95\textwidth}} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \slideheading{USB Controllers} \slidesubheading{} There are two categories of USB controller \begin{description} \item[usb-uhci] For Intel, PIIX4, Via controllers \item[usb-ohci] For Compaq, iMacs, OPTi, SiS, ALi controllers \end{description} \bigskip \begin{itemize} \overlay{1} \item The \underline{UHCI} controllers use a 16 bit IO address: \begin{alltt} I/O at 0xHHHH eg: I/O at 0xe400 \end{alltt} \overlay{2} \item The \underline{OHCI} controllers use a 32 bit memory address: \begin{alltt} memory at 0xHH000000 eg memory at 0xee000000 \end{alltt} \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \Slideheading{USB Controllers} \slidesubheading{} To determine your controller type, examine \texttt{/proc/pci} for a clue: \small \begin{alltt} [root@Node4] root]# cat /proc/pci PCI devices found: ......... Bus 0, device 7, function 2: USB Controller: VIA Technologies Inc. UHCI USB(rev 17). IRQ 10. Master Capable. Latency=32. I/O at 0xe400 [0xe41f]. ......... \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \slideheading{USB Modules} \slidesubheading{} Assuming you have a modular kernel, the following modules will be required: \begin{description} \item[usbcore] The base usb kernel module \item[plus one of the controller specific modules] either \begin{description} \item[usb-uhci] For Intel, PIIX4, Via controllers \item[usb-ohci] For Compaq, iMacs, OPTi, SiS, ALi controllers \end{description} \end{description} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %Andrew Eager \Slideheading{USB Modules} \slidesubheading{Configuration} An entry in \texttt{/etc/modules.conf} aliases the specific controller to usb-controller as follows: \begin{alltt} alias usb-controller usb-uhci \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %Andrew Eager \Slideheading{USB Modules} \slidesubheading{Starting up the USB sub-system} To have the usb sub-sytem startup automatically at boot time, all you need to do is ensure that the above alias line is present in \texttt{/etc/modules.conf}. \overlay{1} To startup manually, do the following steps: \begin{itemize} \overlay{2} \item insmod usbcore \overlay{3} \item insmod usb-uhci (or usb-ohci) \overlay{4} \item mount the usbdevfs filesystem (optional but highly recommended) \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %Andrew Eager \Slideheading{USB Modules} \slidesubheading{Example} \small \begin{itemize} \item \texttt{usbcore} \begin{alltt} [root@Node4]# insmod usbcore Using /lib/modules/2.4.18-4/kernel/drivers/usb/usbcore.o \end{alltt} \overlay{1} \item \texttt{usb-uhci} \begin{alltt} [root@Node4] root]# insmod usb-uhci Using /lib/modules/2.4.18-4/kernel/drivers/usb/usb-uhci.o \end{alltt} \overlay{2} \item \texttt{mount} \begin{alltt} [root@Node4]# mount -t usbdevfs usbdevfs /proc/bus/usb \end{alltt} \overlay{3} \item Once this is done, you should see the following entries in /proc/bus/usb: \begin{alltt} [root@Node4] root]# ls /proc/bus/usb 001 devices drivers \end{alltt} \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \slideheading{USB Interrogation Utilities} \slidesubheading{LSUSB - A console view of USB devices} Lsusb is a text utility contained in the usbutils package. Use 'rpm -Uvh usbutils.xxx.rpm' to install. \begin{alltt} [root@node4]# lsusb Bus 001 Device 001: ID 0000:0000 Virtual Hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.00 bDeviceClass 9 Hub iProduct 2 USB UHCI Root Hub .......... \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager %\Slideheading{USB Interrogation Utilities} \Slidesubheading{LSUSB - A console view of USB devices} \small \begin{alltt} Bus 001 Device 002: ID 03f0:0601 Hewlett-Packard ScanJet 6300c Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.00 bDeviceClass 0 Interface bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x03f0 Hewlett-Packard idProduct 0x0601 ScanJet 6300c bcdDevice 1.00 iManufacturer 1 iProduct 2 HP ScanJet 6300C iSerial 3 SG9941706SPE \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager %\Slideheading{USB Interrogation Utilities} \Slidesubheading{LSUSB - A console view of USB devices} \small \begin{alltt} Bus 001 Device 003: ID 1189:6000 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.00 bDeviceClass 0 Interface bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x1189 idProduct 0x6000 bcdDevice a.03 iManufacturer 0 iProduct 1 USB Optical Storage Device iSerial 0 \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \Slideheading{USB Interrogation Utilities} \slidesubheading{USBVIEW - An X view of USB devices} \begin{itemize} \item Usbview is a gui utility contained in the usbview package. Use 'rpm -Uvh usbview.rpm' to install. \item Usbview parses /proc/bus/usb/devices for connected USB devices. Any device that has a problem will be printed in red. \end{itemize} \fbox{\epsfig{file=../images/usbview.eps,height=.25\textwidth}} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %Andrew Eager \fbox{\epsfig{file=../images/usbview.eps,height=.65\textwidth}} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} %Andrew Eager \slideheading{Hotplugging USB Devices} \slidesubheading{} When a device is plugged into a USB port, it will automatically register itself with the USB subsystem. The upper API drivers will not however automatically 'insmod' themselves unless the hotplug package has been installed. \overlay{1} With the hotplug package installed, an entry in /proc/sys/kernel/hotplug will be created which will contain the name of an executable to be called whenever a new device is detected on the bus. \overlay{2} \begin{alltt} \$ ls /proc/sys/kernel/hotplug /sbin/hotplug \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %Andrew Eager \Slideheading{Hotplugging USB Devices} \slidesubheading{} For example, when a USB scanner is plugged in, hotplug will automatically load the module 'scanner.o'. The xsane application can then be run directly without any user intervention. \begin{itemize} \overlay{1} \item \texttt{/sbin/hotplug} is an executable which is called by the kernel (kernel space to user space interface) \overlay{2} \item \texttt{/etc/hotplug} is a directory containing configuration information for hotplug (which drivers to load when a device is plugged in) \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %ghr \heading{The End} \Slidecontents \vfill \end{slide} %----------------------------------------------------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %============================================================================== %============================================================================== \begin{slide}{} \slideheading{} \vfill \end{slide} %----------------------------------------------------------- ============================================================================= \begin{slide}{} \end{slide} %------------------------------------------------------------------ \fbox{\epsfig{file=images/links2.fig.eps,height=.6\textwidth}}