USB Design by Example: A Practical Guide to Building I/O Devices, Second Edition

The BLOCKIO.SYS driver developed in an earlier section solved the problem of moving large amounts of data between a PC host application and a BlockIO device. It has a simple interface and can be used to solve many design problems. There are occasions when a supplied Windows device driver is preferable when existing applications need to access a new USB I/O device, for example. Microsoft provides a range of class drivers with Window 98 and Windows 2000, and the closest match to a simple bulk-transfer class driver is the Mass Storage Device Driver.
The Mass Storage Device Driver treats your I/O device as if it were a floppy disk, hard drive, or other storage device. An application program would access data on your I/O device the same way that it accesses files on a mass storage device that is, using
Our first stop is, as always, the descriptor tables. We set the class code to 8 to identify a Mass Storage device, set the bInterfaceSubClass to 6 to identify a transparent SCSI connection, and set the bInterfaceProtocol to 50H to identify a BulkOnly transport implementation.
My example is an EZ-USB interface to a hard disk implemented using a Compact Flash card the block diagram is shown in Figure 11-24, and the full schematic is included on the CD-ROM. The configuration descriptor is similar to the BlockIO example, needing two bulk endpoints in addition to the control endpoint.