Chapter 1. Layered Block Device Drivers

Layered block device drivers are 32-bit, flat-model device drivers that execute in protected mode. Windows 95 uses layered block device drivers to manage input and output to block devices, such as disks and CD-ROM devices. These drivers support partitioned and non-partitioned removable media as well as conventional, SCSI, and floptical floppy drives.

Windows 95 also uses layered block device drivers to manage the operation of existing Windows 3.1 FastDisk drivers, Windows 3.1 FastDisk clients and hookers, MS-DOS-based real mode device drivers, and SCSI miniport drivers for Windows NT and Windows 95.

Windows 95 uses a variety of device driver components to support different types of devices and software support. Each component corresponds to a specific layer and has specific responsibilities and requirements. Note that in a typical configuration, only a few of the layers are required for any given device. Only the layers that are required are associated with the device when the device is initialized.

In Windows 95, the layered block device driver components are:

Component Item number(s) in the illustration Description
File system drivers (FSD) 7, 8, 9, 10 Manages the high-level I/O requests from applications. The FSD processes requests from applications and initiates low-level I/O requests through the I/O supervisor. File system drivers are provided by Microsoft.
I/O supervisor (IOS) 13 Provides various services to file system drivers and other drivers in the system. The IOS register drivers, routes and queues I/O requests, sends asynchronous notifications to the drivers as needed, and provide services that drivers can use to allocate memory and complete I/O requests. The IOS also provides Blockdev services to support compatibility with BlockDev clients. The IOS is provided by Microsoft.
Volume tracking driver (volume tracker) 14 Works with a group of devices that share removability rules. The volume tracker ensures that the correct media is in the device and detects and reports improper media removal or insertion.
Type-specific driver (TSD) 15, 16 Works with all devices of a specific type, such as all CD-ROM devices. The TSD validates incoming I/O requests, converts logical requests to physical requests, and notifies the requester when the request is complete. The TSD may also initiate logical error recovery as needed for certain types of device, principally disk.
SCSI'izer 20, 21 Works with all SCSI devices of a given type, such as all SCSI disks. The SCSI'izer constructs SCSI Command Descriptor Blocks (CDBs) for a specific class and carries out device-level error recovery and logging.
Vendor-supplied driver (VSD) 18, 19, 22, 23, 27 Intercepts and processes I/O requests for a given block device. The VSD gives a vendor an efficient way to incorporate enhancements into an existing layered block device driver or to extend the capabilities of the driver to new but similar hardware.
SCSI port driver (SCSI manager) 26 Manages the interaction between the SCSI'izer and a SCSI miniport driver. The SCSI port driver initializes the miniport driver, converts the I/O request format, and carries out all interactions with the miniport driver. The SCSI port driver is provided by Microsoft.
NT SCSI miniport driver 30, 31 Works with a specific set of SCSI adapters. The miniport driver detects and initializes the adapter, handles interrupts, transmits I/O requests to the device, and carries out adapter-level error recovery and logging.
Port driver 24, 25, 27 Works with a specific adapter, usually proprietary. For example, there are port drivers for IDE/ESDI and NEC floppy drivers. A port driver provides the same functionality as a combination of SCSI manager and miniport driver. The port driver detects and initializes the adapter, handles interrupts, transmits I/O requests to the device, and carries out adapter-level error recovery and logging.
Protect mode to real mode mapper 17 Provides the interface between a file system and an MS-DOS real mode driver. The real mode mapper manages MS-DOS-based device drivers while they operate in virtual 8086 mode. The mapper allows binary compatibility for MS-DOS drivers. The mapper is provided by Microsoft.
Real mode driver 28 An existing MS-DOS-based device driver. A real mode driver executes in virtual 8086 mode. Used when there is no protect-mode driver for a given adapter.

The relative position of these different components in the layered model is shown in the illustration below.

Note that the Windows 95 DDK block device documentation concentrates on disk and CD-ROM devices. For information about drivers for block devices other than disk and CD-ROM, see ASPI for Win32. The following abstract describes the usefulness of that documentation.

The Advanced SCSI Programming Interface (ASPI) has become an industry standard SCSI software interface. ASPI allows developers to write device drivers and applications that are independent of the specific host adapter platform used to connect SCSI peripherals. With ASPI, there is a single driver managing the host bus adapter, eliminating conflicts when multiple applications try to access the SCSI bus at the same time.

ASPI for Win32 describes the Advanced SCSI Programming Interface (ASPI) for the Win32 environment.

The ASPI manager for Win32 is implemented as a Dynamic Link Library (DLL) called Wnaspi32.dll. ASPI function calls can be used to retrieve information about installed SCSI host adapters and devices, and to execute SCSI I/O requests. The ASPI for Win32 layer is fully re-entrant, supporting multitasking and multithreaded operations. ASPI for Win32 defines the protocol between ASPI client applications and the ASPI Manager Wnaspi32.dll. It does not describe the protocol between Wnaspi32.dll and the target Win32 environment.