## Physical Device Driver Reference

[prev][next][parent][TOC]

### Mapping Device Names to LID

Having identified its LID and the number of devices or physical units the LID represents, the physical device driver must map each of its device names to a unit within the LID and must support all units under the LID. All physical device drivers are known to the operating system by device names, whether these names correspond to the ASCII string device name in the header for character device drivers or to the logical units (which correspond to drive letters) in the header for block device drivers.

For character device drivers using ABIOS, the device name represents a single device identified by the LID. When a character device driver has a single device driver header, its device name must be mapped to the first unit of the LID it obtained. If the character device driver has one device header but its LID had multiple units, the rest of the units are not used.

When a character device driver has multiple device driver headers, the operating system calls the strategy routine entry point for each header during device driver initialization:

1.The first entry point called must map its device name to the first unit of the LID.
2.The second entry point called must map its device name to the next unit of the LID.
3.If the LID that was obtained by the first entry point has only one unit, the second entry point must obtain another LID and map its device name to the first unit of the second LID.
4.The physical device driver must start with the first LID and consume all the units before going to the next LID.

For a block device driver, the number of units can be placed in the first byte. This is optional because the OS/2 operating system fills this field during device driver initialization. For block device drivers using ABIOS, the number of units is equivalent to the number of devices (or units) under the LID. The block device driver must obtain the necessary number of LID/ units for the number of logical units it supports and must map the first logical unit to the first-LID/first-unit, the second logical unit to the next available LID/unit, and so forth.