/[gentoo]/xml/htdocs/doc/en/usb-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/usb-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 Revision 1.18
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/usb-guide.xml,v 1.8 2005/11/19 20:05:51 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/usb-guide.xml,v 1.18 2008/06/22 01:13:02 nightmorph Exp $ -->
3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 4
6<guide link="/doc/en/usb-guide.xml"> 5<guide link="/doc/en/usb-guide.xml">
7<title>Gentoo Linux USB Guide</title> 6<title>Gentoo Linux USB Guide</title>
8 7
17 16
18<!-- The content of this document is licensed under the CC-BY-SA license --> 17<!-- The content of this document is licensed under the CC-BY-SA license -->
19<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 18<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
20<license/> 19<license/>
21 20
22<version>1.6</version> 21<version>1.14</version>
23<date>2005-11-19</date> 22<date>2008-06-21</date>
24 23
25<chapter> 24<chapter>
26<title>Introduction</title> 25<title>Introduction</title>
27<section> 26<section>
28<title>What is USB?</title> 27<title>What is USB?</title>
53<body> 52<body>
54 53
55<p> 54<p>
56Before we go onto the exact configuration options in the kernel, it would 55Before we go onto the exact configuration options in the kernel, it would
57be apt to look at USB in a little more detail. If you're in a hurry or want 56be apt to look at USB in a little more detail. If you're in a hurry or want
58to skip this section, please go to <uri link="#kernel">Kernel Configuration</uri>. 57to skip this section, please go to <uri link="#kernel">Kernel
58Configuration</uri>.
59</p> 59</p>
60 60
61<p> 61<p>
62A USB system has a host controller, hubs, a <e>root hub</e> amongst others 62A USB system has a host controller, hubs, a <e>root hub</e> amongst others
63and can support up to 127 USB devices including the hubs. The host controller 63and can support up to 127 USB devices including the hubs. The host controller
145<title>Kernel Configuration</title> 145<title>Kernel Configuration</title>
146<section> 146<section>
147<title>Getting the kernel</title> 147<title>Getting the kernel</title>
148<body> 148<body>
149 149
150<note>
151Since the 2005.0 release, Gentoo Linux uses 2.6 as the default kernel. Unless
152you are specifically using the 2.4 profile, <c>gentoo-sources</c> will be a
1532.6 kernel on <e>most</e> architectures. Please check your kernel version and
154then proceed with the configuration accordingly.
155</note>
156
157<p> 150<p>
158First emerge the kernel sources of your choice. Here we'll use the 151First emerge the kernel sources of your choice. Here we'll use the
159<c>gentoo-sources</c>. For more information on the various kernel sources 152<c>gentoo-sources</c>. For more information on the various kernel sources
160available on Portage, please look up the <uri 153available on Portage, please look up the <uri
161link="/doc/en/gentoo-kernel.xml">Gentoo Linux Kernel Guide</uri>. 154link="/doc/en/gentoo-kernel.xml">Gentoo Linux Kernel Guide</uri>.
179the kernel sources you want to use. Please ensure the same before proceeding. 172the kernel sources you want to use. Please ensure the same before proceeding.
180</note> 173</note>
181 174
182</body> 175</body>
183</section> 176</section>
184<section id="2.6.xconfig"> 177<section>
185<title>Config options for the 2.6.x kernel</title> 178<title>Config options for the kernel</title>
186<body> 179<body>
187 180
188<p> 181<p>
189Now we will look at some of the options we will have to enable in the 2.6 182Now we will look at some of the options we will have to enable in the kernel to
190kernel to ensure proper USB support for our devices. If you are using a 2.4 183ensure proper USB support for our devices.
191kernel, please proceed with <uri link="#2.4.xconfig">Config options for the
1922.4.x kernel</uri>.
193</p> 184</p>
194 185
195<note> 186<note>
196Examples in this document will show configuration options for basic USB 187Examples in this document will show configuration options for basic USB
197support as well as those needed commonly, for example a USB mass storage 188support as well as those needed commonly, for example a USB mass storage
202have the options compiled into the kernel. If you would like to have a modular 193have the options compiled into the kernel. If you would like to have a modular
203kernel, ensure that you note down the various modules and adjust your config 194kernel, ensure that you note down the various modules and adjust your config
204files accordingly. 195files accordingly.
205</note> 196</note>
206 197
207<pre caption="make menuconfig options for 2.6 kernels"> 198<pre caption="make menuconfig options">
208Device Drivers ---&gt; 199Device Drivers ---&gt;
209 SCSI device support ---&gt; 200 SCSI device support ---&gt;
210 201
211<comment>(Although SCSI will be enabled automatically when selecting USB Mass Storage, 202<comment>(Although SCSI will be enabled automatically when selecting USB Mass Storage,
212we need to enable disk support.)</comment> 203we need to enable disk support.)</comment>
232 223
233<comment>(Moving a little further down, we come to CDC and mass storage.)</comment> 224<comment>(Moving a little further down, we come to CDC and mass storage.)</comment>
234&lt; &gt; USB Modem (CDC ACM) support 225&lt; &gt; USB Modem (CDC ACM) support
235&lt;*&gt; USB Printer support 226&lt;*&gt; USB Printer support
236&lt;*&gt; USB Mass Storage support 227&lt;*&gt; USB Mass Storage support
237 [*] USB Mass Storage Write-Protected Media Detection (EXPERIMENTAL)
238
239<comment>(Then the HID bits.
240You have to select HID input support if you have a USB keyboard,
241mouse, joystick or any other USB input device)</comment>
242--- USB Input Devices
243&lt;*&gt; USB Human Interface Device (full HID) support
244 [*] HID input layer support
245 228
246<comment>(If you have a USB Network Card like the RTL8150, you'll need this)</comment> 229<comment>(If you have a USB Network Card like the RTL8150, you'll need this)</comment>
247USB Network Adapters ---> 230USB Network Adapters --->
248 &lt;*&gt; USB RTL8150 based ethernet device support (EXPERIMENTAL) 231 &lt;*&gt; USB RTL8150 based ethernet device support (EXPERIMENTAL)
249 232
252 &lt;*&gt; USB Serial Converter support 235 &lt;*&gt; USB Serial Converter support
253 &lt;*&gt; USB Prolific 2303 Single Port Serial Driver (NEW) 236 &lt;*&gt; USB Prolific 2303 Single Port Serial Driver (NEW)
254</pre> 237</pre>
255 238
256<p> 239<p>
240If you have a USB keyboard, mouse, joystick, or any other input device, you need
241to enable HID support. Go back one level to "Device drivers" and enable HID
242support as shown:
243</p>
244
245<pre caption="Enabling HID support">
246Device Drivers ---&gt;
247 [*] HID Devices ---&gt;
248 &lt;*&gt; USB Human Interface Device (full HID) support
249</pre>
250
251<p>
257Now that your options are set, you can (re)compile the kernel and USB support 252Now that your options are set, you can (re)compile the kernel and USB support
258should be functional once you reboot into the new kernel. You can now proceed 253should be functional once you reboot into the new kernel. You can now proceed
259to <uri link="#postkern">Seeing USB at work</uri> and see if everything is 254to <uri link="#postkern">Seeing USB at work</uri> and see if everything is
260working as it should. 255working as it should.
261</p>
262
263</body>
264</section>
265<section id="2.4.xconfig">
266<title>Config options for the 2.4.x kernel</title>
267<body>
268
269<p>
270We will look at the options the we will have to enable in the 2.4 kernel to
271ensure proper USB support for our devices. If you are using a 2.6 kernel,
272please look at <uri link="#2.6.xconfig">Config options for the 2.6.x
273kernel</uri>.
274</p>
275
276<note>
277Examples in this document will show configuration options for basic USB
278support as well as those needed commonly, for example a USB mass storage
279device (most cameras and USB pen drives). If you have a specific USB device
280that needs to be configured, please look up your device's manual or search
281online to see if that device has support built-in into the kernel or custom
282drivers that you can use. Please note that for the sake of ease, all examples
283have the options compiled into the kernel. If you would like to have a modular
284kernel, ensure that you note down the various modules and adjust your config
285files accordingly.
286</note>
287
288<pre caption="make menuconfig options for 2.4 kernels">
289<comment>(This immediate config is only for those who have USB input devices.
290Input core support is needed by USB HID later.)</comment>
291Input core support ---&gt;
292 &lt;*&gt; Input core support
293 &lt; &gt; Keyboard support
294 &lt; &gt; Mouse support
295 &lt; &gt; Event interface support
296
297USB support ---&gt;
298
299<comment>(This is the root hub and is required for USB support.
300If you'd like to compile this as a module, it will be called usbcore.o)</comment>
301&lt;*&gt; Support for USB
302
303<comment>(Enable this option to see your USB devices in /proc/bus/usb.
304This is recommended.)</comment>
305 [*] Preliminary USB device filesystem
306
307<comment>(Select at least one of the HCDs. If you are unsure, picking all is fine.)</comment>
308--- USB Host Controller Drivers
309&lt;*&gt; UHCI Alternate Driver (JE) support
310&lt; &gt; OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support
311
312<comment>(This is the device section. Select only what you need.)</comment>
313--- USB Device Class drivers
314&lt; &gt; USB Audio support
315&lt;*&gt; USB Mass Storage support
316&lt; &gt; USB Modem (CDC ACM) support
317&lt;*&gt; USB Printer support
318
319<comment>(Followed by the HID section. This is needed if you have an USB based input device.)</comment>
320--- USB Human Interface Devices (HID)
321&lt;*&gt; USB Human Interface Device (full HID) support
322 [*] HID input layer support
323
324<comment>(If you have a serial to USB converter like the Prolific 2303, you'll need this)</comment>
325USB Serial Converter support --->
326 &lt;*&gt; USB Serial Converter support
327 &lt;*&gt; USB Prolific 2303 Single Port Serial Driver (NEW)
328</pre>
329
330<p>
331Now that the options are set, you can (re)compile the kernel and USB support
332should be functional once you reboot into the new kernel.
333</p> 256</p>
334 257
335</body> 258</body>
336</section> 259</section>
337</chapter> 260</chapter>
511which helps debugging as well as understanding how USB works. 434which helps debugging as well as understanding how USB works.
512</p> 435</p>
513 436
514</body> 437</body>
515</section> 438</section>
516<section>
517<title>Hot or Cold plug??</title>
518<body>
519
520<p>
521Gentoo uses two packages, <c>sys-apps/hotplug</c> and <c>sys-apps/coldplug</c>
522to do some magic with <e>hot-pluggable</e> devices. Just like any other magic
523trick, there is a simple logic behind this one too. We shall now see what that
524is, and in the process hopefully we will be able to understand these twins
525better.
526</p>
527
528<p>
529Firmware can be defined as the software on a piece of hardware that is loaded
530and executed but can't be modified easily. Many devices have firmware in them
531to ensure that they work properly and often firmware may contain code that is
532critical to ensure that the hardware performs as expected. Firmware is present
533in a wide variety of computer devices ranging from ROM chips to state of the
534art USB and PCMCIA cards. When a device is plugged in, the firmware (which may,
535in some cases, be the driver as well) is read and loaded onto memory after
536which the device can be used by the system.
537</p>
538
539<p>
540To cut the long story short, Gentoo uses <c>sys-apps/hotplug</c> to handle
541the firmware side of things in <e>hot-pluggable</e> devices.
542<c>sys-apps/hotplug</c> will use the required firmware to make that device
543usable. The firmware should be put in the <path>/lib/firmware</path> directory
544and is picked up from there. Getting it is simple; the usual emerge will do.
545</p>
546
547<pre caption="Installing hotplug">
548# <i>emerge hotplug</i>
549</pre>
550
551<p>
552Now the obvious question would be, what is coldplug and why is it needed?
553<c>sys-apps/coldplug</c> does what hotplug does, but it does it for
554<e>hot-pluggable</e> devices that are already connected at boot time. A good
555example of this would be a USB Network card. Earlier, hotplug was the package
556responsible for handling both, but then it was split into hotplug and coldplug,
557with coldplug doing all the work. Install it if you have <e>hot-pluggable</e>
558devices that you need activated on boot up.
559</p>
560
561<pre caption="Installing coldplug">
562# <i>emerge coldplug</i>
563<comment>(And you can add it to the boot runlevel)</comment>
564# <i>rc-update add coldplug boot</i>
565 * coldplug added to runlevel boot
566 * rc-update complete.
567</pre>
568
569<note>
570The above initscript does what hotplug's initscript used to do (for already
571attached hot-pluggable devices). The current <path>/etc/init.d/hotplug</path>
572script does nothing more than check if the CONFIG_HOTPLUG is enabled for the
573current kernel.
574</note>
575
576</body>
577</section>
578</chapter> 439</chapter>
579 440
580<chapter> 441<chapter>
581<title>And thanks to...</title> 442<title>And thanks to...</title>
582<section> 443<section>
583<title>References</title> 444<title>References</title>
584<body> 445<body>
585 446
586<p> 447<p>
587A good number of online documents helped me during the development of this 448A good number of online documents helped me during the development of this
588document and there are some that are highly technical but truly interesting. 449document and there are some that are highly technical but truly interesting.
589I thought they all deserve some credit, so here we go! 450I thought they all deserve some credit, so here we go!
590</p> 451</p>
591 452
592<ul> 453<ul>
593 <li><uri link="http://www.usb.org">The Official USB Website</uri></li> 454 <li><uri link="http://www.usb.org">The Official USB Website</uri></li>
607 </li> 468 </li>
608</ul> 469</ul>
609 470
610</body> 471</body>
611</section> 472</section>
473<section>
474<title>Other Interesting Links</title>
475<body>
476
477<ul>
478 <li><uri link="/doc/en/liveusb.xml">Gentoo Linux LiveUSB HOWTO</uri></li>
479</ul>
480
481</body>
482</section>
612</chapter> 483</chapter>
613</guide> 484</guide>

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20