site logo  PDDHeader

HomePage | Categories |* BLOG *| RecentChanges | RecentlyCommented | Login/Register

Revision [540]

Last edited on 2007-08-20 15:47:07 by MikeGreene
Additions:
The first data segment of a physical device driver must contain a device header as the first item. The structure of a physical device driver header is shown in the following table.
{{table columns="2" cellpadding="0" cells="Field;Length;Far Pointer to Next Device Header;DWORD;Device Attribute;WORD;16 Bit Offset to Strategy Routine;WORD;16 Bit Offset to IDC Entry Point;WORD;Driver Name or Units (if block device);8 BYTES;Reserved;8 BYTES;Capabilities Bit Strip (only in level 3 device driver);DWORD"}}
This pointer is set at the time the physical device driver is loaded. This field should be set to -1.
**Device Attribute Field**
Describes the characteristics of the physical device driver to the system. The format of the OS/2 device attribute field is:
{{image class="center" alt="devatt" title="PDD DevAttribute" url="http://www.mgreene.org/graphics/devatt.jpg"}}
The attributes are:
**CHR (Bit 15)** Set, if the physical device driver operates in character mode. Bit 15 is the device type bit. Use bit 15 to tell the system if the device driver is a block or character device. For block device drivers, bit 15 is 0. For character device drivers, bit 15 is 1.
**IDC (Bit 14)** Set, if the physical device driver participates in inter-device-driver communication (IDC). Bit 14 is the IDC bit and indicates that the offset to the IDC entry point in the physical device driver header is set.
I**BM (Bit 13)** Set, if non-IBM block format (block device drivers only). For block device drivers, bit 13 indicates the method the physical device driver uses to determine the media type. If a block device driver uses information in the BIOS Parameter Block (BPB) to determine the media type, bit 13 should be set to 1. If the physical device driver uses the media descriptor byte to determine the media type, bit 13 must be 0.
**SHR (Bit 12)** Set, if the device driver supports shared-device access-checking (character devices). Bit 12 is the shared bit. It is set if the device name is not to be protected by the sharer. Bit 12 has no meaning for block device drivers and must be 0. If clear (default), file system sharing rules do not apply to the device, and the physical device driver provides contention control. If set, file system sharing rules apply to the device, just as they apply to any other file system name. In addition, any given physical device can have only one logical name. (Devices cannot have aliases.)
**OPN (Bit 11)** Set, if the device driver supports removable media (block devices) or device open/close (character devices). For block device drivers, bit 11 is the removable media bit. If set, this bit indicates that the physical device driver handles removable media. For character device drivers, bit 11 is the open/close bit. If set, this bit indicates that the physical device driver must receive OPEN and CLOSE request packets.
- **Bit 10** Reserved=0.
- **Bits 9-7** Bits 9-7 indicate the physical device driver function level, where:
{{image class="center" alt="devatt1" title="PDD DevAttribute Func Lvl" url="http://www.mgreene.org/graphics/devatt1.jpg"}}
- **Bit 6** Reserved=0.
- **Bit 5** Reserved=0.
- **Bit 4** Reserved=0.
- **CLK (Bit 3)** Set, if CLOCK device. Bit 3 is the clock device bit. It is used by a character device driver to indicate the system clock device.
- **NUL (Bit 2)** Set, if NULL device. Bit 2 is the NULL attribute bit. It is used by character devices only. Bit 2 is used to tell the OS/2 operating system if the character device driver is a NULL device. Although there is a NULL device attribute bit, the NULL device cannot be reassigned. (This attribute exists so that the operating system can tell if the NULL device is being used.)
- **SCR (Bit 1)** Set, if standard output device (STDOUT). For character devices, bits 1 and 0 are the standard input or standard output bits. These bits are used to tell the OS/2 operating system if the character device driver is the new standard input or standard output device.
- **KBD (Bit 0)** Set, if standard input device (STDIN). See above.
- **Bit 0** Set to 1, if DosDevIOCtl2 request packets are supported, and if shutdown support is provided.
- **Bit 1** For block device drivers, this bit is reserved and must be set to 0. Block device drivers indicate their ability to support greater than 16MB by way of the Query Device Parameters IOCtl (Category 08h, Function 63h) Device attributes field, bit 2. For character device drivers, this bit is set to 1 (if memory addressing above 16MB is supported, that is, support for full 32-bit memory addressability verses 24-bit memory addressability).
- **Bit 2** Set to 1, if the physical device driver supports parallel ports.
- **Bit 3** Indicates that the physical device driver is participating in the adapter device driver strategy, which, in turn, selects an alternate INIT request packet format from the kernel.
- **Bit 4** If set to 1, the Initialization Complete Command (1Fh) is supported.
- **Bits 5-31** Reserved. Must be set to 0.
Deletions:
This pointer is set by OS/2 2.1 (or later) at the time the physical device driver is loaded. This field should be set to -1.
**Device Attribute**
Describes the characteristics of the physical device driver to the system.
- Bit 0 Set to 1, if DosDevIOCtl2 request packets are supported, and if shutdown support is provided.
- Bit 1 For block device drivers, this bit is reserved and must be set to 0. Block device drivers indicate their ability to support greater than 16MB by way of the Query Device Parameters IOCtl (Category 08h, Function 63h) Device attributes field, bit 2. For character device drivers, this bit is set to 1 (if memory addressing above 16MB is supported, that is, support for full 32-bit memory addressability verses 24-bit memory addressability).
- Bit 2 Set to 1, if the physical device driver supports parallel ports.
- Bit 3 Indicates that the physical device driver is participating in the adapter device driver strategy, which, in turn, selects an alternate INIT request packet format from the kernel.
- Bit 4 If set to 1, the Initialization Complete Command (1Fh) is supported.
- Bits 5-31 Reserved. Must be set to 0.


Revision [539]

The oldest known version of this page was created on 2007-08-20 15:36:25 by MikeGreene
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.7
Page was generated in 0.2018 seconds