USB_BETA 1.0 OSR5 USB Support from What is it? Universal Serial Bus (USB) for SCO OpenServer 5.0.6 supports the use of USB peripherals. This first release supports 3 device classes including keyboard, mouse, and mass storage as well as USB hubs. These device classes are managed by a USB protocol stack that monitors the USB bus device enumeration, configuration, use, and detachment. While USB supports Hot Swap, OSR5 does not. This means that attaching and detaching USB devices during their use could cause unexpected behaviour. This beta release of the code is provided to give users a first exposure to USB on OSR5. Please read the below 'Known Problems' section before installing this software. Additional device class support is being developed and will be released in the future as a suppliment for OSR5. Comments on usability, future device class support, etc. are welcome. ------------------------------------------------------------------------------ Features of the USB - USB devices may be plugged in before or after the host has booted. These devices will be placed in a ready state, configured, and used directly. - Removable Media USB Zip Drives may now be used with OSR5. - Many combinations of hubs and USB devices may be configured for use to a maximum of 128 devices. - USB bus support is present in most modern computers and offers an inexpensive device connection opportunity. ------------------------------------------------------------------------------ Installation *** WARNING! THIS IS BETA SOFTWARE. USE AT YOUR OWN RISK! *** USB_BETA has been tested on the following release: SCO OpenServer 5.0.6 1. Before beginning, be sure that USB support is enabled in CMOS setup. 2. Place the usb_beta-1.0.tar.Z file in the /tmp directory, then run these commands as root: # cd / # uncompress /tmp/usb_beta-1.0.tar.Z # tar xf /tmp/usb_beta-1.0.tar # cd /tmp # ./install.sh The install.sh script will install and/or update all necessary files. There is no remove script provided, but backup copies of all modified files are saved to be used if a removal is required. Each saved file will be appended with .b4usb. For example, /etc/conf/cf.d/mevent is changed so the original copy of the file is changed to be mevent.b4usb. The install.sh script is commented to provide a view of what is changed and where so that a removal is possible. 3. After the kernel is relinked, shutdown and reboot the system: # shutdown Observe the new %usb message during the boot sequence. 4. To configure a Zip Drive on the USB bus The USB mass storage is integrated through the SCSI subsystem and so the install is just like adding a SCSI Disk. It is a two step process. This installation sample will assume a simple single filesystem configuration. SCO system documentation may be used for variations on this basic theme. Another issue to be aware of. During this install, its assumed that a writable media is inserted in the drive. The results of this install will prepare the current media for filesystem use. Once that media is removed and a virgin media inserted, the media preparation process must be repeated. DO NOT confuse this install process with media preparation!!! To prepare virgin media, only fdisk and divvy are used, DO NOT REPEAT these two install steps! Step 1 # mkdev hd Pick one of the choices below or you may quit and invoke mkdev hd -u for a detailed usage message. 1) Add a hard disk to IDE controller 2) Add a hard disk to SCSI controller 3) Add a hard disk to IDA controller Enter 1, 2, 3 or enter 'q' to quit: 2 Enter the prefix of the SCSI host adapter that supports this device or press for the default: 'alad' Enter h for a list of host adapters or enter q to quit: usbha Which 'usbha' SCSI host adapter supports this device? Select 0-1, or enter q to quit: 0 The Host Adapter parameters will be automatically configured What SCSI Bus is this device attached to? Press to use the default:0 Select 0-n, or h for help, or q to quit: 0 What is the Target ID for this device? Select 0-15, or h for help, or q to quit: 0 What is the LUN of this device? Press to use the default: 0 Select 0-7, or h for help, or q to quit: 0 You are about to add the following SCSI device: Host Adapter Adapter Type Device Number ID LUN BUS ---------------------------------------------- usbha Sdsk 0 0 0 0 Update SCSI configuration? (y/n) y The SCSI configuration file has been updated. A new kernel must be built and rebooted before disk configuration can continue. Would you like to relink at this time? (y/n) y The UNIX Operating System will now be rebuilt. This will take a few minutes. Please wait. Root for this system build is / The UNIX Kernel has been rebuilt. Do you want this kernel to boot by default? (y/n) y Backing up unix to unix.old Installing new unix on the boot file system The kernel environment includes device node files and /etc/inittab. The new kernel may require changes to /etc/inittab or device nodes. Do you want the kernel environment rebuilt? (y/n) y after the relink, reboot the new kernel and move on to step 2. Step 2 # mkdev hd Pick one of the choices below or you may quit and invoke mkdev hd -u for a detailed usage message. 1) Add a hard disk to IDE controller 2) Add a hard disk to SCSI controller 3) Add a hard disk to IDA controller Enter 1, 2, 3 or enter 'q' to quit: 2 Enter the prefix of the SCSI host adapter that supports this device or press for the default: 'usbha' Enter h for a list of host adapters or enter q to quit: <- press return Which 'usbha' SCSI host adapter supports this device? Select 0-1, or enter q to quit: 0 The Host Adapter parameters will be automatically configured What SCSI Bus is this device attached to? Press to use the default:0 Select 0-n, or h for help, or q to quit: 0 What is the Target ID for this device? Select 0-15, or h for help, or q to quit: 0 What is the LUN of this device? Press to use the default: 0 Select 0-7, or h for help, or q to quit: 0 During installation you may choose to overwrite all or part of the present contents of your hard disk. Do you wish to continue? (y/n) y The hard disk installation program will now invoke /etc/fdisk. Entering 'q' at the following menu will exit /etc/fdisk, and the hard disk installation will continue. If you wish to exit the entire installation at this menu, press the key. 1. Display Partition Table 2. Use Entire Disk for UNIX 3. Use Rest of Disk for UNIX 4. Create UNIX Partition 5. Activate Partition 6. Delete Partition 7. Create Partition Enter your choice or 'q' to quit: 2 Current Hard Disk Drive: /dev/rdsk/1s0 +-------------+----------+-----------+---------+---------+---------+ | Partition | Status | Type | Start | End | Size | +-------------+----------+-----------+---------+---------+---------+ | 1 | Active | UNIX | 1 | 6079 | 6079 | +-------------+----------+-----------+---------+---------+---------+ Total disk size: 6144 tracks (65 reserved for masterboot and diagnostics) Press to continue 1. Display Partition Table 2. Use Entire Disk for UNIX 3. Use Rest of Disk for UNIX 4. Create UNIX Partition 5. Activate Partition 6. Delete Partition 7. Create Partition Enter your choice or 'q' to quit: q scsi version = 7 vendor = IOMEGA product = ZIP 100 1. Scan entire UNIX partition 2. Scan a specified range of blocks 3. Scan a specified filesystem 4. List current bad block table 5. Add entries to bad block table 6. Delete entries from bad block table 7. Clear bad block table 8. Re-allocate bad blocks Enter your choice or q to quit: q 0 bad blocks have been found. Enter the number of bad blocks to allocate space for or press to use the existing value of 511. WARNING: Changing the value will remove all filesystems in this partition: There are 96256 blocks in the UNIX area. Please enter the number of file systems you want this area to be divided into, or press to get the default of 1 file system(s) The layout of the filesystems and swap area is now prepared. Do you wish to make any manual adjustments to the sizes or names of the filesystems or swap area before they are created on the hard disk? (y/n) y +-------------------+------------+--------+---+-------------+------------+ | Name | Type | New FS | # | First Block | Last Block | +-------------------+------------+--------+---+-------------+------------+ | d1250 | HTFS | yes | 0 | 0| 96255| | | NOT USED | no | 1 | -| -| | | NOT USED | no | 2 | -| -| | | NOT USED | no | 3 | -| -| | | NOT USED | no | 4 | -| -| | | NOT USED | no | 5 | -| -| | | NOT USED | no | 6 | -| -| | d1257all | WHOLE DISK | no | 7 | 0| 97263| +-------------------+------------+--------+---+-------------+------------+ 96256 1K blocks for divisions, 1008 1K blocks reserved for the system n[ame] Name or rename a division. c[reate] Create a new file system on this division. d[elete] Delete a file system on this division. t[ype] Select or change filesystem type on new filesystems. p[revent] Prevent a new file system from being created on this division. s[tart] Start a division on a different block. e[nd] End a division on a different block. r[estore] Restore the original division table. Enter your choice or q to quit: n which division? (0 through 7)?0 what do you want to call it? zip100 +-------------------+------------+--------+---+-------------+------------+ | Name | Type | New FS | # | First Block | Last Block | +-------------------+------------+--------+---+-------------+------------+ | zip100 | HTFS | yes | 0 | 0| 96255| | | NOT USED | no | 1 | -| -| | | NOT USED | no | 2 | -| -| | | NOT USED | no | 3 | -| -| | | NOT USED | no | 4 | -| -| | | NOT USED | no | 5 | -| -| | | NOT USED | no | 6 | -| -| | d1257all | WHOLE DISK | no | 7 | 0| 97263| +-------------------+------------+--------+---+-------------+------------+ 96256 1K blocks for divisions, 1008 1K blocks reserved for the system n[ame] Name or rename a division. c[reate] Create a new file system on this division. d[elete] Delete a file system on this division. t[ype] Select or change filesystem type on new filesystems. p[revent] Prevent a new file system from being created on this division. s[tart] Start a division on a different block. e[nd] End a division on a different block. u[ndo] Undo the last change. r[estore] Restore the original division table. Enter your choice or q to quit: q i[nstall] Install the division set-up shown r[eturn] Return to the previous menu e[xit] Exit without installing a division table Please enter your choice: i Making filesystems Hard disk initialization procedure completed. This completes the filesystem creation. Now I just verify it for grins. # fsck /dev/rzip100 (Note that I use the created raw device file for fsck) HTFS File System: zip100 Volume: zip100 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Synchronous Write Log ** Phase 6 - Check Free List Bitmap 2 files 15 blocks 93230 free # mount /dev/zip100 /mnt (But when you mount, you use the block device) # df -vi (This to show its available space) Mount Dir Filesystem blocks used free %used iused ifree %iused / /dev/root 8530258 910544 7619714 11% 42739 1023549 5% /stand /dev/boot 30720 18076 12644 59% 17 3823 1% /mnt /dev/zip100 192512 6138 186374 4% 4 24060 1% This completes the addition of the USB disk drive and mounting it as a filesystem. 4. To configure a mouse on the USB bus, login as the root user and ... # mkdev mouse Mouse Initialization Program 1. Display current configuration 2. Add a mouse to the system 3. Remove a mouse from the system 4. Associate a terminal with an existing mouse 5. Disassociate a terminal from an existing mouse 6. Remove the mouse drivers from the kernel Select an option or enter q to quit: 2 Reading device entries.... The following mouse device types are supported: 1. Serial mouse 2. Bus mouse 3. PS/2-style keyboard mouse (IRQ 12) 4. USB Mouse/Trackball mouse Select an option or enter q to return to the previous menu: 4 The following USB mouse devices are supported: 1. USB Kensington Orbit Trackball Select an option or press q to return to the top level: 1 USB Kensington Orbit Trackball is currently configured to attach to the system on /dev/usb/ums0. Do you want to install this mouse on a different port? (y/n) n This mouse may be configured for use on any of the system's terminals and multiscreens. The multiscreens and terminals that will be associated with this mouse need to be specified. Specify them by entering, at the following prompt, all the ttys to be associated with this mouse. Entering the word "multiscreen" will associate all of the console multiscreens. Enter a list of terminals (e.g. tty1a tty2a multiscreen) or enter q to quit. The default is multiscreen. Press return when finished: Associating the multiscreens... Do you want to use the USB Kensington Orbit Trackball on any other terminals? (y/n) n You must create a new kernel to effect the driver change you specified. Do you wish to create a new kernel now? (y/n) y The UNIX Operating System will now be rebuilt. This will take a few minutes. Please wait. Root for this system build is / The UNIX Kernel has been rebuilt. Do you want this kernel to boot by default? (y/n) y Backing up unix to unix.old Installing new unix on the boot file system The kernel environment includes device node files and /etc/inittab. The new kernel may require changes to /etc/inittab or device nodes. Do you want the kernel environment rebuilt? (y/n) y The kernel has been successfully linked and installed. To activate it, reboot your system. Setting up new kernel environment If you have successfully added a Graphic Input Device to the system and you wish to use 'usemouse(C)', or another application or utility which uses pseudo-ttys, you should add a suitable number of pseudo-tty devices to the system using 'mkdev ptty'. (See the System Administrator's Guide for details.) Mouse Initialization Program 1. Display current configuration 2. Add a mouse to the system 3. Remove a mouse from the system 4. Associate a terminal with an existing mouse 5. Disassociate a terminal from an existing mouse 6. Remove the mouse drivers from the kernel Select an option or enter q to quit: q Now reboot the host to activate the new kernel. After the reboot, the Kensington Trackball should work with scologin. Another test process is the usemouse program. You may invoke that with, # usemouse -c "vi /tmp/install.sh" 6. To configure a keyboard on the USB bus Just plug it in, there is no configuration necessary. Note however that this USB keyboard needs the protocol stack to work, so when you boot your host, the boot colon prompt entry must be done with a PS2 keyboard. After the boot time banners, the enter Control D to continue, at this point the USB keyboard is now active. ------------------------------------------------------------------------------ General Items - Preparing Additional Disk Media The preparation of virgin media for use as a mounted filesystem requires the use of two SCO utilities, fdisk and divvy. This sample will assume that the user has the USB drive as the second mass storage disk on the UNIX host. Step 1 # fdisk -f /dev/rhd1a 1. Display Partition Table 2. Use Entire Disk for UNIX 3. Use Rest of Disk for UNIX 4. Create UNIX Partition 5. Activate Partition 6. Delete Partition 7. Create Partition Enter your choice or 'q' to quit: 2 Current Hard Disk Drive: /dev/rhd1a +-------------+----------+-----------+---------+---------+---------+ | Partition | Status | Type | Start | End | Size | +-------------+----------+-----------+---------+---------+---------+ | 1 | Active | UNIX | 1 | 6079 | 6079 | +-------------+----------+-----------+---------+---------+---------+ Total disk size: 6144 tracks (65 reserved for masterboot and diagnostics) Press to continue 1. Display Partition Table 2. Use Entire Disk for UNIX 3. Use Rest of Disk for UNIX 4. Create UNIX Partition 5. Activate Partition 6. Delete Partition 7. Create Partition Enter your choice or 'q' to quit: q Step 2 # divvy -m /dev/hd1a +-------------------+------------+--------+---+-------------+------------+ | Name | Type | New FS | # | First Block | Last Block | +-------------------+------------+--------+---+-------------+------------+ | zip100 | HTFS | no | 0 | 0| 96255| | | NOT USED | no | 1 | -| -| | | NOT USED | no | 2 | -| -| | | NOT USED | no | 3 | -| -| | | NOT USED | no | 4 | -| -| | | NOT USED | no | 5 | -| -| | | NOT USED | no | 6 | -| -| | d1257all | WHOLE DISK | no | 7 | 0| 97263| +-------------------+------------+--------+---+-------------+------------+ 96256 1K blocks for divisions, 1008 1K blocks reserved for the system n[ame] Name or rename a division. c[reate] Create a new file system on this division. d[elete] Delete a file system on this division. t[ype] Select or change filesystem type on new filesystems. p[revent] Prevent a new file system from being created on this division. s[tart] Start a division on a different block. e[nd] End a division on a different block. r[estore] Restore the original division table. Enter your choice or q to quit: c which division? (0 through 6)?0 +-------------------+------------+--------+---+-------------+------------+ | Name | Type | New FS | # | First Block | Last Block | +-------------------+------------+--------+---+-------------+------------+ | zip100 | HTFS | yes | 0 | 0| 96255| | | NOT USED | no | 1 | -| -| | | NOT USED | no | 2 | -| -| | | NOT USED | no | 3 | -| -| | | NOT USED | no | 4 | -| -| | | NOT USED | no | 5 | -| -| | | NOT USED | no | 6 | -| -| | d1257all | WHOLE DISK | no | 7 | 0| 97263| +-------------------+------------+--------+---+-------------+------------+ 96256 1K blocks for divisions, 1008 1K blocks reserved for the system n[ame] Name or rename a division. c[reate] Create a new file system on this division. d[elete] Delete a file system on this division. t[ype] Select or change filesystem type on new filesystems. p[revent] Prevent a new file system from being created on this division. s[tart] Start a division on a different block. e[nd] End a division on a different block. u[ndo] Undo the last change. r[estore] Restore the original division table. Enter your choice or q to quit: q i[nstall] Install the division set-up shown r[eturn] Return to the previous menu e[xit] Exit without installing a division table Please enter your choice: i Making filesystems This completes the media preparation, it will now be mountable. This must be repeated for each new media. If you find yourself doing this a lot, yell and I'll email you a script for doing it. - Using The usbtree Tool To Report The USB Devices Configured # usbtree Tree: 1 Port: 0 description not found (vend=0 product=1) Tree: 2 Port: 1 UT-USB41 hub {Texas Instruments} Tree: 3 Port: 1 Orbit USB/PS2 trackball {Kensington} Tree: 4 Port: 4 Zip 100 Mass Storage Device {Iomega Corp.} This tool is still quite rough. Port 0 is really the Root Hub. The device mapping has yet to be verified. The main use is to do the SCSI Inquiry equivalent for USB. This lookup of manufacturer and device is stored in code. If you run this tool and have hardware not found, please let me know what you have so I can add the data to the out device table. The information I'm interested in is the manufacturer name and the device function. You may email it to me. ------------------------------------------------------------------------------ Known Problems - USB chip from VIA technologies If you have trouble with mass storage, check your hardware. Use the command, # hw -r pci | more Look for entries like ... Index: 4 DeviceNum: 7 Function: 2 Bus: 0 VendorId: VIA Technologies, Inc. DeviceId: VT82C586A/B Apollo Chipset, Function 2: USB Bridge RevId: 0x02 Command: 0x0007 Memory Enabled, I/O Enabled Status: 0x0200 ClassCode: 0x0c0300 Universal Serial Bus (USB) bus controller CacheLineSize: 8 32 bit words LatencyTimer: 0x40 HeaderType: 0x00 Single-function, Standard encoding BaseAddr[4]: I/O 0xe000 SubsysVendorID: 0x0925 SubsystemID: 0x1234 InterruptLine: IRQ-11 InterruptPin: INTD This VIA Technologies Chip is known to fail. If you find an entry like ... Index: 4 DeviceNum: 7 Function: 2 Bus: 0 VendorId: Intel DeviceId: 430TX USB Host controller RevId: 0x01 Command: 0x0005 Memory Disabled, I/O Enabled Status: 0x0280 ClassCode: 0x0c0300 Universal Serial Bus (USB) bus controller CacheLineSize: 0 No limiting LatencyTimer: 0x40 HeaderType: 0x00 Single-function, Standard encoding BaseAddr[4]: I/O 0x1040 InterruptLine: IRQ-9 InterruptPin: INTD This Intel Chipset seems to work fine. - Only one mouse device has been tested(Kensington Orbit Trackball) - Only one drive unit is currently supported (Iomega Zip) - USB keyboard support is not well polished with PS2 legacy keyboard. One annoyance is the shutdown procedure. The USB stack is hosed during shutdown so if you do an init 0, when the 'press any key to reboot' is displayed, neither the dead USB keyboard nor the PS2 keyboard will work. the reset button on the host must be used. ------------------------------------------------------------------------------ Limited Support - Questions, problems, and success-stories may be directed to me: usbtls@sco.com