Anonymous user
Universal Serial Bus: Difference between revisions
Jump to navigation
Jump to search
rewrote supporting usb section, renamed it to introduction, moved it up. fixed some typos and grammatical errors, added links from article to the links section, removed irrelevant links
[unchecked revision] | [unchecked revision] |
m (Corrected small typo) |
(rewrote supporting usb section, renamed it to introduction, moved it up. fixed some typos and grammatical errors, added links from article to the links section, removed irrelevant links) |
||
Line 1:
The Universal Serial Bus was first introduced in 1994 with the intention of replacing various specialized interfaces, and to simplify the configuration of communication devices. The communication industry did not develop as the USB-IF foresaw, but the various transfer modes that USB introduced allowed it to become one of the most popular standards in use today. Virtually every modern computer supports USB.
== Introduction ==
Despite how attractive USB support is, the 650-page USB 2.0 specification manages to deter even some of the most driven hobbyists (especially if English isn't
=== What this text covers ===
The truth is that
Chapter 11 is specific to hubs and is also essential for a full USB 2.0 implementation, however it is almost as long as chapters 4, 5, 8, 9, and 10 combined, and could be regarded as the documentation for a specific (albeit special) class of USB devices. Chapter 11 is covered thusly in its own wiki entry, [[USB Hubs]]. Even so, some concepts which pertain to USB hubs are briefly discussed where relevant in this article.
Ideally, the text here will establish familiarity with the terms and concepts that a hobby OS developer needs to begin implementing USB support and, if necessary, easily parse the USB specification without becoming intimidated by the amount of information. At the very least, the system programmer should keep a copy of the USB 2.0 specification for reference while working with USB-related hardware.
Fortunately, all of the necessary documentation is available for free:▼
* [http://www.usb.org/developers/docs/usb_20_052709.zip USB 2.0 Specifications]▼
* [http://www.intel.com/technology/usb/download/ehci-r10.pdf EHCI Specifications]▼
* [http://download.intel.com/technology/usb/UHCI11D.pdf UHCI Specifications]▼
* [http://www.o3one.org/hwdocs/usb/hcir1_0a.pdf OHCI Specifications]▼
=== What this text does not cover ===
Please note that USB, unlike other standards like [[VGA]] or [[PCI]], is agnostic of the hardware interface to the system bus (and, by extension, to the operating system). Such an interface is provided by one or more [[#Host_Controllers|USB host controllers]] and is defined by the appropriate documentation. Therefore, one should not expect this text to discuss specifics or code samples (e.g., as one finds in the wiki entries about [[VGA]] or [[PCI]]) detailing how the operating system initiates and maintains communication with USB devices. Although such information may be found on wiki entries discussing a particular [[#Host_Controller_Driver|Host Controller Driver]], those wiki entries assume an understanding of the concepts and terms discussed here.
== Host Controllers ==
Line 15 ⟶ 34:
In designing USB 2.0, the USB-IF insisted on a single implementation. That single implementation is Intel's '''Extended Host Controller Interface''' ('''EHCI'''). However, even though the USB 2.0 specification requires that a USB 2.0 interface support USB 1.0 devices, this doesn't mean that the EHCI must support USB 1.0 devices, and in fact, it doesn't. Each EHCI host controller is accompanied by (usually several) UHCI and/or OHCI host controllers. When a USB 1.0 device is attached, the EHCI simply hands control over to a '''companion controller'''. Refer to figure 1 for a simple block diagram implementation of this behavior. Therefore, the system programmer must support all three standards in order to support USB 2.0.
The EHCI host controller only handles USB 1.0 devices if they are attached indirectly through a USB 2.0 hub. The specifics of handling USB 1.0 devices attached to a USB 2.0 hub are briefly discussed and illustrated in the [[#Hubs|hubs]] section, and in more detail
'''Specifications'''
Line 25 ⟶ 44:
'''Specifications'''
* [http://www.usb.org/developers/docs/usb_30_spec_052109.zip USB 3.0 Specifications]
▲Despite how attractive USB support is, the 650-page USB 2.0 specification manages to deter even some of the most driven hobbyists (especially if English isn't a his/her primary language). Not only is the USB 2.0 specification long, but it's a prerequisite for the EHCI, UHCI, and OHCI specifications, all of which must be implemented for full USB 2.0 support.
▲The truth is that you don't need to read the entire USB 2.0 specification; there are sections specific to hardware developers, for example. The information presented here attempts to summarize chapters 4, 5, and 8 through 11, but reading those sections of the specification is recommended.
▲Fortunately, all of the necessary documentation is available for free:
▲* [http://www.usb.org/developers/docs/usb_20_052709.zip USB 2.0 Specifications]
▲* [http://www.intel.com/technology/usb/download/ehci-r10.pdf EHCI Specifications]
▲* [http://download.intel.com/technology/usb/UHCI11D.pdf UHCI Specifications]
▲* [http://www.o3one.org/hwdocs/usb/hcir1_0a.pdf OHCI Specifications]
== Basic Concepts and Nomenclature ==
Line 73 ⟶ 79:
</gallery>
[[Image:USBTopology.gif|thumb|right|Figure 8: USB Topology]]
==== USB Interconnect ====
Line 107 ⟶ 108:
Besides the two required endpoints, functions may implement additional endpoints as necessary, with the following limitations:
* Low-speed functions may implement up to two additional endpoints.
* Full- and high-speed devices may implement up to 15 additional input endpoints and 15 additional output endpoints.
==== Endpoint Zero ====
Line 267 ⟶ 268:
==== Bus Time Rationing ====
There are separate rules for the allocation of frames on a full-
For full- or low- speed buses:
Line 1,937 ⟶ 1,938:
==== STRING ====
Devices may optionally support STRING descriptors. If a device does not support STRING descriptors, any field which references the index of a STRING descriptor must be reset to zero. STRING descriptors use unicode encodings and may support multiple languages. The host requests a STRING descriptor with the [[#GET_DESCRIPTOR|GET_DECRIPTOR]] request and must pass the 16-bit LANGID (as defined by the USB-IF) of the desired language in the ''wIndex'' field. The list of currently accepted LANGIDs is located
String index 0 for all languages returns a STRING descriptor that contains an array of all the two-byte LANGID codes that the device supports.
Line 2,048 ⟶ 2,049:
* [http://www.usb.org/home USB.org]
* [http://www.usb.org/developers/docs/usb_20_052709.zip USB 2.0 Specifications]
* [http://www.kernel.org/ The Linux kernel] (though things tends to be confusing there, and you have to be careful with educating yourself from Linux sources if your project isn't GPL'ed).
* [http://www.beyondlogic.org/usbnutshell/usb1.htm USB in a Nutshell] may also interest you. It looks like a really good tutorial giving all the required knowledge to understand any other USB documentation/source code in a couple of HTML pages ...
* [http://www.usb.org/developers/docs/USB_LANGIDs.pdf Currently accepted LANGIDs]
* '''Host Controller Documentation:'''
** [http://www.intel.com/technology/usb/download/ehci-r10.pdf EHCI Specifications]
** [http://download.intel.com/technology/usb/UHCI11D.pdf UHCI Specifications]
** [http://www.o3one.org/hwdocs/usb/hcir1_0a.pdf OHCI Specifications]
=== Forum Topics ===
* [[Topic:8096|USB driver]] - suggests a few startup links about USB
* [[Topic:9063|Collecting links about USB]] - PypeClicker and Df's collection of links about USB
|