?? dosusb.htm
字號:
</font><font face="Arial" size="4"><b>7. Planned features for the next release</b></font></p>
<p><font face="Arial">- support for isochronous transfers in OHCI.</font></p>
<p><font face="Arial"><br>
</font><font face="Arial" size="4"><b>8. USB reference material</b></font></p>
<p><font face="Arial">Writing USB device drivers requires a good understanding
of the<br>
USB specifications. Here are some documents to get started:</font></p>
<p><font face="Arial">"USB in a nutshell"<br>
A good introduction to the USB specifications. Available from:<br>
www.beyondlogic.org</font></p>
<p><font face="Arial">"USB Made Simple"<br>
Another fine introduction by MQP Electronics.<br>
www.mqp.com/ums_1.htm</font></p>
<p><font face="Arial">Some notes about the USB specifications can be found here:<br>
www.computer-engineering.org/index.php?title=USB_Notes</font></p>
<p><font face="Arial">"Universal Host Controller Interface (UHCI) Design
Guide" by Intel. <br>
This is the interface DosUSB is based on for its UHCI part.<br>
www.intel.com/technology/usb/</font></p>
<p><font face="Arial">"OpenHCI Open Host Controller Interface Specification
for USB" by Compay, Microsoft,<br>
National Semiconductor. This is the specification for the OHCI part of DosUSB.<br>
http://download.microsoft.com/download/whistler/hwdev1/1.0/wxp/en-us/hci_1.exe<br>
http://h18000.www1.hp.com/productinfo/development/openhci.html</font></p>
<p><font face="Arial">"USB 2.0 specifications"<br>
Once you've read "USB in a nutshell" you have to consult this reference.<br>
www.usb.org/developers</font></p>
<p><font face="Arial">"USB complete" by Jan Axelson<br>
Probably the most important book on USB. The author's web site is:<br>
www.lvr.com/usb.htm</font></p>
<p><font face="Arial">"USB Tracker" by Ellisys<br>
This is a good USB scope and currently one with a relatively low<br>
price. If you download their demonstration software, you get<br>
excellent examples of USB communications with different devices.<br>
www.ellisys.com</font></p>
<p><font face="Arial">To write a device driver for a floppy drive or mass storage<br>
device you will usually only need the class specifications from<br>
www.usb.org. However, many devices have vendor specific commands<br>
which often are not made available. Some of these specifications<br>
can be gathered from the Linux USB driver implementations.</font></p>
<p><font face="Arial"><br>
</font><font face="Arial" size="4"><b>9. USB analysers</b></font></p>
<p><font face="Arial">If you develop a device driver using DosUSB, a USB protocol<br>
analyser will be of great value.</font></p>
<p><font face="Arial">The best choice is a hardware monitor such as the USB
Tracker by<br>
Ellisys.</font></p>
<p><font face="Arial">Besides this device, there are software USB analysers
e.g.:<br>
USB Monitor at www.hddsoftware.com,<br>
USBinfo at http://lpt.usbfireinfo.com<br>
or SourceUSB at http://www.sourcequest.com. </font></p>
<p><font face="Arial">There is also a free software USB sniffer at<br>
http://sourceforge.net/projects/usbsnoop<br>
or at<br>
http://benoit.papillault.free.fr/usbsnoop</font></p>
<p><font face="Arial">These tools are cheaper than the USB Tracker but only
allow you<br>
to monitor the traffic between Windows and a USB device. However,<br>
you can see how windows communicates with the device.</font></p>
<p><font face="Arial">Finally there are devices which allow you to use a logic
analyser<br>
to monitor USB traffic: www.futureplus.com.</font></p>
<p><font face="Arial"><br>
</font><font face="Arial" size="4"><b>10. Samples</b></font></p>
<p><font face="Arial">The package contains samples of programs which use the
DosUSB<br>
driver. These are not complete device drivers, they shall only<br>
show the functionality of the DosUSB driver.</font></p>
<p><font face="Arial">USBVIEW is a Powerbasic program which will display all<br>
descriptors of a device.</font></p>
<p><font face="Arial">MOUSE is a demo program which reads the input from a USB
mouse.</font></p>
<p><font face="Arial">LQ590.bas is a sample which prints a short text on an
Epson LQ-590<br>
printer.</font></p>
<p><font face="Arial">HPLASER.bas will print the file DOSUSB.TXT on a HP Laserprinter.<br>
It uses PCL commands to set up the printer for text output.</font></p>
<p><font face="Arial">Most low cost USB printers are GDI or Windows printers
which will not<br>
print ASCII codes sent to them. They expect data which controls their<br>
print head. This protocol is vendor specific and usually not available.<br>
If a printer accepts ASCII code via its parallel interface, it usually<br>
can also do this via its USB interface. GDI printers can only be used with <br>
Win 3.11 since there are no GDI drivers for DOS available.</font></p>
<p><font face="Arial">SETALT.bas is a sample to set an alternate interface of
a device. </font></p>
<p><font face="Arial">ENUM.c is a Turbo C sample to retrieve a device descriptor.</font></p>
<p><font face="Arial">ENUM.bas is a Powerbasic sample to retrieve a device descriptor.</font></p>
<p><font face="Arial">ENUM.asm retrieves a device descriptor using assembler.</font></p>
<p><font face="Arial">HPLASER.pas is a sample in Pascal to print dosusb.txt
to an HP Laserjet<br>
printer.<br>
Michel LECLERC translated HPLASER.bas to this Pascal sample.</font></p>
<p><font face="Arial">HPLASERV.bas is a Visual Basic for DOS sample to print
dosusb.txt to an<br>
HP Laserjet printer. Converted from hplaser.bas for Powerbasic.</font></p>
<p><font face="Arial">RESET.bas resets and enumerates all connected devices.
This will not check<br>
for additionally connected devices and not remove the addresses<br>
for disconnected devices. So the addresses for all devices will not change.</font></p>
<p><font face="Arial">RESTART.bas resets and enumerates all connected devices.
This will assign<br>
addresses to additionally connected devices and remove the addresses<br>
for disconnected devices. The addresses for other devices may change.</font></p>
<p><font face="Arial">ICHECK.bas checks whether the DosUSB driver is installed
and running.</font></p>
<p><font face="Arial">KEYBOARD.bas reads the keys typed on a USB keyboard. The
USB HID to PS/2<br>
scan code translation table can be found at the microsoft site in the document:<br>
</font><a href="http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf"><font
face="Arial">translate.pdf</font></a></p>
<p><font face="Arial">CABLE.bas is a sample which sends data via a PC connect
USB cable from one<br>
USB port to a second USB port.</font></p>
<p><font face="Arial">READER.bas reads sector zero of a memory card in a USB
card reader.</font></p>
<p><font face="Arial">STICK.BAS is very similar to READER.bas and reads sector
zero of a <br>
USB memory stick.</font></p>
<p><font face="Arial">STICK.PAS, RESTART.PAS and RESET.PAS are samples converted
to <br>
Pascal by Joe da Silva</font></p>
<p><font face="Arial">FLOPPY.bas will read the boot sector of a floppy in a
USB floppy drive.</font></p>
<p><font face="Arial">CAMERA.bas reads isochronous data from a Trust 120 Spacecam
camera and<br>
saves it in the file image.yuv. Will run with UHCI only.</font></p>
<p><font face="Arial">SCANNER.bas is a sample which reads the identity of an
Epson Perfection<br>
1670 scanner. This does not use the ESC/I commands.</font></p>
<p><font face="Arial">PRNUSB.sys is a printer device driver which uses DosUSB
to print to USB<br>
printers. Tested with a HP 2420d Laserprinter and will also run with a<br>
HP 880C, a HP 5940 and a HP 460C inkjet printer. It will also work with<br>
parallel to USB adapters. Check the endpoints and use the setalt utility to<br>
set the interface before printing here.</font></p>
<p><font face="Arial">It is loaded with a "device=" statement in the
config.sys file. Load<br>
DosUSB then, do not use the /D command line option here!<br>
The default device address is one, the default device endpoint is two. Use<br>
the command line options e.g. /D2 /E1 to select device address two and<br>
endpoint number one. Use USBView to determine the right settings for your<br>
printer.<br>
Cannot be used with low cost GDI printers, since these do not accept ASCII<br>
code for printing. However, since drivers for GDI printers are available for
WIN 3.11, <br> if you use DosUSB and PRNUSB.SYS with WIN 3.11, you can also
use these GDI printers with PRNUSB.SYS.There are no drivers for these printers
in DOS, however.<br>
<br>
Use "type dosusb.txt > prnusb" to print this file from the DOS
prompt. Or<br>
open "prnusb" as a file in your application program.<br>
PRNUSB.asm is the source code for this driver.</font></p>
<p><font face="Arial">LPT1USB.SYS is a variant of PRNUSB.SYS which installs
as a LPT1: device. So<br>
you can print from the DOS Editor or other application programs directly.</font></p>
<p><font face="Arial">USBDISK.SYS is a device driver for flash drives and other
mass storage devices <br>
such as USB hard disks and PCMCIA cards in USB card readers. <br>
It is currently provided as a beta version.</font></p>
<p><font face="Arial">Since DosUSB does not support EHCI which allows for higher
transfer speeds,<br>
the transfer is a bit slower than the one achived with Windows. </font></p>
<p><font face="Arial">It is loaded with a "device=" statement in the
config.sys file such as:<br>
device=c:\dosusb\usbdisk.sys provided the file usbdisk.sys in the c:\dosusb
<br>
directory on your hard disk. </font></p>
<p><font face="Arial">If you have more than one USB device connected to the
PC and the flash drive<br>
is not the first device to get address number one, you can use the /D command
<br>
line option. This way you can specify the address of the flash drive. DosUSB
<br>
will always give the same address to each device connected to the PC as long<br>
as no device is removed or added. So if you found out, which address the<br>
flash drive gets from DosUSB you can specify that with the /D option. Without<br>
the /D option USBDISK.SYS assumes address one.<br>
USBDISK.SYS reads the device descriptor to determine the endpoints so these
do<br>
not need to be set by a command line option.</font></p>
<p><font face="Arial">Then boot the PC to have DOS load usbdisk.sys as specified
in config.sys. Since<br>
this is a block device driver, it cannot be loaded later with devload.</font></p>
<p><font face="Arial">When DOS boots and loads the USBDISK.SYS driver, the driver
will display the drive<br>
letter DOS has assigned to the mass storage device.</font></p>
<p><font face="Arial">Plug in your flash drive now. Always use the same slot,
to avoid to get a <br>
different address than before.</font></p>
<p><font face="Arial">Start dosusb (without the /D option for log-file creation)</font></p>
<p><font face="Arial">Now you can do a "dir" command on the flash
drive and copy files from the drive <br>
to the hard disk and from the disk to the drive. You can also delete files etc.<br>
Even if there are no files in the directory, DOS does a lot of reads which<br>
will cause a long delay at the end of the "dir" command to determine
the free space on the device. Using "dir" with the "/B"
option will be much quicker.</font></p>
<p><font face="Arial"> Remarks:</font></p>
<p><font face="Arial">USBDISK.SYS does not support changing the mass storage
device yet. If you connect a different flash disk you have to reboot your PC
to reload USBDISK.SYS or your data will be corrupted.</font></p>
<p><font face="Arial">If you have booted DOS from drive A: there may be a fixed
disk installed in your PC which your version of DOS did not specify a drive
letter for. Then the drive letter DOS gives to USBDISK.SYS may cause problems.</font></p>
<p><font face="Arial">If the mass storage device is not formatted it is not
supported by USBDISK.SYS. It will not return that the device is unformatted.</font></p>
<p><font face="Arial">USBDISK.SYS will just access the first partition of a
USB hard disk.</font></p>
<p><font face="Arial">If your flash disk has a write protect switch, this will
not be queried by USBDISK.SYS. So DOS can copy to the flash disk even when the
write protect switch is set.</font></p>
<p><font face="Arial">Windows opens a small window showing how much data has
been copied. DOS does<br>
not do that. So with large files it seems that nothing is happening - but<br>
DOS does copy!</font></p>
<p><font face="Arial">Better remove usbdisk from the config.sys file before
booting Windows - some Windows<br> versions may try to access the device which
USBDISK.SYS provides when running SCANDISK.</font></p>
<p><font face="Arial">So there are several issues left to improve for the next
release. However, it took quite a lot of time to develop USBDISK.SYS and it
can be used to transfer files successfully now.</font></p>
<p><font face="Arial"><br>
17th February 2007 Georg Potthast<br>
</font></p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -