STREAM, BLOCK, BUS, AND USB DRIVERS
As introduced in this chapter, stream device drivers are used when the device acts as a data source, a data sink, or both. This is the most common device driver architecture used in Windows Embedded Compact. Data is streamed to or from the device in a serial manner, on a per byte basis. Stream drivers are covered in detail in Chapters 32 and 33.
Two other driver formats are block and bus drivers. They may actually be implemented as stream drivers though. A block driver reads and writes data as fixed sized blocks. Individual bytes within a block cannot be addressed on the device for reading and writing. A bus device driver controls a bus such as a PCI, a USB, an SD, an I2C, and an ISA (PC104). Note that PCMCIA/Card Bus is not supported in Compact 7, whereas the I2C bus has been added. Bus drivers determine the correct driver for devices connected to them and therefore load them with their correct drivers.
Mass storage devices such as hard disk drives, flash memory cards, CDs and DVDs, various USB storage devices, and RAM disks would be loaded with a block driver. Common block sizes, the quantum of data accessed at any one time, are 512, 1K, 2K, and 4K bytes. The operating system file system is implemented to store a file as a number of blocks. Block drivers are generally implemented as stream drivers with the block movements implemented in the driver IOCTL interface (see Chapter 32, “Steam Interface Driver”). Most block drivers are based upon ...