## Input/Output Device Driver Reference

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

### OS/2 Initialization Architecture

The following steps describe the initialization flow of the PCMCIA software components in the OS/2 operating system. Card Services, the Resource Management Utility, and Socket Services are implemented as base devices ( BASEDEV=). These BASEDEV drivers initialize in the order in which they occur in CONFIG.SYS, prior to any client drivers. Client drivers, unless they are ADDs, should be implemented as non-base device drivers (DEVICE=). After the BASEDEV drivers, the client drivers will then initialize in the order in which they occur in CONFIG.SYS.

1.Card Services Initialization

The Card Services component is implemented as an installable physical device driver. This component manages resources (I/O address space, IRQs, and memory) across the set of installed client device drivers and Socket Services. The Card Services component assumes that a default set of resources is available when it is initialized, and then adjusts the resource information (see Step 2) to limit or expand this resource base. The base set of resources that the Card Services component assumes are available to be managed, is defined as follows:

Non-system memory in the range C0000h - DFFFFh
IRQs in the range 2 through 15
I/O addresses in the range 0108h through FFFFh, with the following exceptions:
-Addresses 3B4h, 3B5h, 3BAh, 3BBh, and 3C0h through 3DFh are reserved for video use.
-Addresses 3F0h through 3F7h are reserved for diskette use.

2.Resource Map Initialization

The Resource Map utility program is a special client device driver that determines the current system's hardware resource pool. This client is a hardware-specific device driver that performs the resource pool determination in a hardware-specific manner.

The Resource Map utility program determines the system's resource information and informs Card Services by way of the AdjustResourceInfo (35h ) function during BASEDEV INIT (1Bh) command processing. If an incorrect Resource Map utility program or no Resource Map utility program is loaded, Card Services continues to run, managing the default set of resources it assumed were present. (See Step 1).

Because the Resource Map utility program is hardware-specific, it is provided by the hardware manufacturer on either the diskette that came with the computer or the diskette that came with the PCMCIA adapter.

3.Socket Services Initialization

a.One or more Socket Services device drivers can be loaded into the operating system to support the adapters in the system unit. As each Socket Services device driver loads, it must verify the required hardware dependencies. During the BASEDEV INIT command (1Bh) processing, Socket Services device drivers must complete their inter-device-driver communication (IDC) initialization processing by calling the DevHlp_ AttachDD function. If Card Services is loaded, the request for an IDC entry point for the device driver name "PCMCIA$ " (PCMCIA$, followed by a blank space) returns the 16:16 protect-mode information. The Socket Services device drivers then call the Card Services AddSocketServices (32h) function to establish the bidirectional IDC interface links. If the AttachDD request fails, the Socket Services device driver must free any allocated resources and permit itself to be swapped out of the active system memory as needed.

b.Card Services processes the AddSocketServices (32h) function by:

1.Identifying the Socket Services resources required.

Card Services uses the following Socket Services functions to determine setup resources: GetAdapterCount (80h), GetSSInfo (83h), GetVendorInfo (9Dh ), InquireAdapter (84h), GetAdapter (85h), InquireSocket (8Ch), and GetSocket ( 8Dh).

2.Allocating resources from the resource map for Socket Services.

Card Services assigns resources for the new Socket Services support, if available.

3.Installing interrupt handlers for the Socket Services hardware.

Card Services uses the DevHlp_SetIRQ function to establish the adapter- specific interrupt handling routine for each adapter supported by the Socket Services currently initializing.

4.Programming the Socket Services hardware for the allocated resources.

Card Services uses the following Socket Services functions to activate the adapter hardware: SetAdapter (86h), SetSocket (8Eh).

4.COM.SYS Physical Device Driver Initialization

The COM physical device driver provides a set of additional client device driver IDC interfaces for transparent application support. (See COM Support for more details).

During initialization processing, the COM physical device driver determines if the special COM client device driver interface support is needed. It then loads or discards the support modules appropriately. The determination is made by issuing the DevHlp_AttachDD with the device driver name "PCMCIA$ " (PCMCIA$, followed by a blank space) specified for the Card Services physical device driver.

5.Client Device Driver Initialization

Several client device drivers can be loaded into the operating system to support the various cards that might be plugged into the system's PCMCIA sockets. The initialization processing for these PCMCIA client device drivers is minimal. The card must be initialized on an as-needed basis because a card can be inserted into a socket at any time. To be ready for events such as CARD_INSERTION, the client device driver must establish an IDC interface connection into Card Services. The IDC link is established during either the INIT command (00h) or the INIT_COMPLETE command (1Fh) processing, by using the DevHlp_AttachDD function. If Card Services is loaded, the request for an IDC entry point for the device driver name " PCMCIA$ " returns the 16:16 protect-mode information. If the AttachDD request fails, the client device driver must enter a dormant state equivalent to the wait state that would be entered when a card is not present. As soon as the presence of Card Services is confirmed and the interface address is retrieved, the client device driver issues the RegisterClient request and enters the normal mode of event processing.