usb -- Universal Serial Bus


Universal Serial Bus (USB) is a low-cost, hot-pluggable device bus that is supported by most modern motherboards and is also available through add-in cards. In SCO OpenServer, the USB interface is implemented via the Uniform Driver Interface (UDI). Three USB Host Controller Interfaces (HCI) exist and are supported by this implementation:

HCI name USB standard Speed
Universal Host Controller Interface (UHCI) USB 1.1 12Mbps
Open Host Controller Interface (OHCI) USB 1.1 12Mbps
Enhanced Host Controller Interface (EHCI) USB 2.0 480Mbps

 HCI name                                     USB standard   Speed
 Universal Host Controller Interface (UHCI)   USB 1.1        12Mbps
 Open Host Controller Interface (OHCI)        USB 1.1        12Mbps
 Enhanced Host Controller Interface (EHCI)    USB 2.0        480Mbps

USB 1.1 devices are typically low-cost, low-bandwidth units. USB 2.0 offers speeds up to 480 megabits per second, which is comparable to mid-range IDE and SCSI bus speeds.

USB hubs and USB devices (such as mice, keyboards, and mass storage devices) may be plugged into the host. A maximum of 128 devices may be nested up to 8 layers deep using combinations of hubs and devices. USB devices may be attached before or after the host computer starts; devices may be unplugged from the bus while the computer is running.

Mouse and keyboard devices send very little data across the USB bus. Other devices, such as mass storage, use bulk transfer mode to move data blocks over the bus, but the data rates achieved are typically less than SCSI or IDE bus devices. USB is an effective mechanism for adding devices to a host that does not already have that functionality, such as adding a mouse or trackball to a laptop or adding supplementary storage such as a Zip® or CD-ROM drive. USB can be used for hard disk storage when top performance is not required.

Note the following when using these supported USB device types:



NOTE: USB keyboards cannot be used in the following situations:



CD-ROM/DVD-ROM drives and CD/DVD writers


Root hub

The ``root hub'' refers to the USB ports configured on the motherboard. Many systems allow built-in USB ports to be disabled in BIOS setup. If USB is not working, check that it is enabled in the BIOS. Alternatively, if you do not wish to use USB, you may want to disable it in the BIOS setup since many motherboards use two to three interrupts for USB HCIs.

Connectivity options

The root hub ports may be used for either a USB device or a USB hub. Any combination of hubs and devices may be connected, up to the maximum device limit and the hub depth -- 128 devices nested 8 layers deep.

Software layers

USB devices are supported by a layered software implementation. Inside the kernel, there are several layers of software for USB support, including the USB protocol stack and USB class drivers. USB devices are configured using the mkdev(ADM) commands, such as mkdev mouse or mkdev hd. These commands provide access to USB devices from user applications.

USB protocol stack

The central driver of the USB protocol stack is the USB stack manager, usbd. This driver maintains an internal representation of the ``tree'' of USB hubs and devices. It notices the appearance and disappearance of devices as they are physically attached to and removed from ports and hubs. usbd attaches and detaches device descriptors to the corresponding USB class drivers.

USB class drivers

USB class drivers handle the attaching, detaching, and accessing of various classes of devices. SCO OpenServer includes separate class drivers for keyboard and mouse (usb_hid), mass storage devices (usb_msto), and hubs (usb_hub).

USB device configuration

USB mass storage devices look like SCSI devices to the kernel. The following table lists the different types of USB storage devices, the corresponding SCSI driver name, and the mkdev(ADM) script you use to configure the device:

Peripheral type Driver name mkdev command
Hard disk Sdsk mkdev hd
Removable disk Sdsk or Sflp mkdev hd, mkdev flopti (mkdev ls120)
CD-ROM drive Srom mkdev cdrom

 Peripheral type   Driver name    mkdev command
 Hard disk         Sdsk           mkdev hd
 Removable disk    Sdsk or Sflp   mkdev hd, mkdev flopti (mkdev ls120)
 CD-ROM drive      Srom           mkdev cdrom

When you physically attach a USB storage device to the system, a kernel configuration message is displayed on the console. As an example, a hard disk might produce a message similar to:

   %disk - - - type=S unit=1 ha=0 id=2 lun=0 bus=0 ht=usb_msto

In this message:

Once the USB storage device is plugged in, you must run the appropriate mkdev(ADM) script, as shown in the above table. You are prompted for the USB device ID that was listed in the id= field in the kernel configuration message. (You can also determine a device's ID by running hwconfig(C) with the -h option and locating the entry for the desired USB device in the resulting hardware list.)

Normally when adding a new SCSI device, you are required to relink the kernel and reboot the system. Because USB devices are hot-pluggable, however, this step is not always necessary.

Configuring hard disks
Use mkdev hd to configure USB hard disks, supplying the appropriate USB device ID for the device. Using the hard disk example shown above, you would enter USB ID 2. Because the device is already present and recognized, it is not necessary to relink the kernel and reboot the system.

You then need to run mkdev hd a second time to set up partitions, divisions, and filesystems.

Configuring removable storage devices
Removable USB storage devices, such as Zip, Jaz®, LS-120, LS-240, and floppy drives, flash memory devices, and certain cameras, are recognized by both the Sdsk and Sflp drivers.

NOTE: You cannot use USB removable storage devices, including floppy and LS-120/LS-240 drives, to format media.

By default, the system kernel is configured with the /dev/fd0 and /dev/fd1 device nodes. Depending on the number of traditional floppy drives attached to the motherboard floppy controller, you may be able to use one or both of these device nodes for USB removable devices, instead of running the device-specific mkdev(ADM) scripts. For example, if your system contains one traditional floppy drive, you can access one USB removable storage device from /dev/fd1. If you are not using any traditional floppy drives, you can access two USB removable storage devices from /dev/fd0 and /dev/fd1.

Sflp units are enumerated last in the list of floppy devices. If there is a standard floppy drive and a USB LS-120 drive on the system, the LS-120 will be /dev/fd1 and the standard floppy drive will be /dev/fd0.

NOTE: Most of the other floppy device nodes created (see fd(HW) for details) are only useful for USB removable storage devices that can use traditional floppy media (for example, floppy and LS-120 drives). Also see the floptical(HW) manual page for more information.

Configuring CD-ROM and DVD-ROM drives and writers
Use mkdev cdrom to configure USB CD-ROM and DVD-ROM devices. These devices can be mounted for read-only random access. Writable devices can be written with software such as cdrecord.

USB device IDs

When you attach a USB mass storage device, the system assigns the device a USB device ID. (USB device IDs are only assigned to USB storage devices, not to non-storage devices like mice and keyboards.) USB device IDs are determined by the order in which the system detects each device. However, the enumeration of devices depends on several factors and different circumstances may result in different device ID assignments on the same machine. For example, devices that you attach to a running system are enumerated in the order that you plug them in. At boot time, however, the entire USB hub/device tree is traversed and devices may be detected in a different order, resulting in different device ID assignments. In general, these guidelines apply:

The following example illustrates a situation in which previously assigned USB device IDs could change.

If you have a computer that contains a USB CD-ROM drive as the only USB storage device, the CD-ROM drive is assigned USB device ID 0 when the system is booted. If you then hot-add a USB LS-120 drive, it is assigned USB device ID 1. Finally, you plug in an external USB hard drive and it is assigned USB device ID 2.

After running mkdev cdrom, mkdev ls120, and mkdev hd to configure the USB storage devices, the appropriate device nodes are created and the /etc/conf/cf.d/mscsi file is updated to contain entries similar to:

   usb_msto    Srom   0   0   0   0
   usb_msto    Sflp   0   1   0   0
   usb_msto    Sdsk   0   2   0   0

In this example, when you reboot the system, it is possible that the USB LS-120 device could now be assigned device ID 2 and the USB hard drive has switched to device ID 1. (If the CD-ROM drive remains the first detected device in the USB chain, it would retain device ID 0.) Now, if you access /dev/hd10, the system tries (most likely unsuccessfully) to use the LS-120 drive instead of the hard drive, and vice versa.

If you encounter a situation like this, you need to edit the mscsi(F) file and modify the usb_msto entries so the correct device IDs are assigned to the appropriate driver. (To confirm the USB device ID assignments on your system, run hwconfig -h. Check the value of the id= field for each of the USB mass storage device entries (usb_msto) in the list of hardware. In this example, you would change the mscsi file to read:

   usb_msto    Srom   0   0   0   0
   usb_msto    Sdsk   0   1   0   0
   usb_msto    Sflp   0   2   0   0

After editing the mscsi file, you need to relink the kernel and reboot the system. When the system is running again, the attached USB storage devices should now function properly.

Any time you make a change to the number or order of USB storage devices on the system, you may need to edit the mscsi file as described above. See the mscsi(F) and scsi(HW) manual pages for more information.

Device drivers in the USB protocol stack

HCI drivers
Controls I/O to the various USB host controllers found on motherboards and add-in cards. The HCI drivers include:

Enhanced Host Controller Interface (hardware driver)

Open Host Controller Interface (hardware driver)

Universal Host Controller Interface (hardware driver)

Host Controller UDI meta-language

Communications interface between the USB stack and the HCI drivers.

USB stack manager

Communications interface between the USB stack and the HCI drivers. This driver maintains an internal representation of the ``tree'' of USB hubs and devices, and attaches/detaches device descriptors to corresponding USB class drivers as USB peripherals are added/removed.

USB stack utilities library

Utility functions used by usbd.

OpenUSBDI UDI meta-language

USB ``tree'' management functions used by usbd.

Hub (USB class driver)

Class driver for managing USB hubs.

Printer (USB class driver)

Class driver for managing USB printers.

Mass storage (USB class driver)

The pseudo Host Bust Adapter driver. This is the driver that appears in the mscsi(F) file to attach USB storage devices to SCSI peripheral drivers.

Human Interface Device (USB class driver)

Class driver for talking to Human Interface Devices (mice, keyboards, and so forth.)

Human Interface Device parser library

Functions for decoding messages from HID devices.

Human Interface Device UDI meta-language

Functions for controlling HID devices.

SCO OpenServer keyboard mapper

Connects HID keyboard type devices to the SCO OpenServer console driver.

SCO OpenServer mouse mapper

Connects HID ``pointing device'' type devices to the SCO OpenServer event driver.


system device configuration files and utilities

USB device nodes

device files for mice

See also

cdrom(HW), hd(HW), mkdev(ADM), mouse(HW), mscsi(F), Sflp(HW)

Standards conformance

This USB interface conforms to Release 2.0 of the USB specification. For more information, see the USB web page.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 19 November 2003