PSD INSTALL

Determine if the PSD supports the current platform.

This function probes the hardware to see if the PSD supports the current platform. No other operations should be executed in this function. It is merely a presence check. This function is the first function called upon loading a PSD. It must store away all the information passed to it in the install structure.


 * Mode Called in Init Mode; may be called in Kernel Mode.

Syntax
 PSD_INSTALL 

Parameters

 * Entry : Pointer to an INSTALL structure.

Structure
 typedef struct install_s { P_F_2  pPSDHlpRouter;  (Input) char  *pParmString;    (Input) void  *pPSDPLMA;       (Input) ulong_t sizePLMA;      (Input) } INSTALL; 


 * pPSDHlpRouter points to the PSD help router. Use the PSDHelp macro in PSD.H to access the PSD helps.
 * pParmString points to any parameters specified in CONFIG.SYS after the PSD' s name. If no parameters were specified this field is NULL.
 * pPSDPLMA points to the PSD's processor local memory area. This area contains different physical memory at the same linear address across all processors. You can use the area to store variables such that each processor accesses unique values, but all the code references the same variables.
 * sizePLMA is the total size of the PSD's PLMA in bytes.

Return Code
Exit
 * NO_ERROR : if the PSD installed successfully.
 * -1 : if the PSD does not support the current platform.

Remarks
This function may be called after OS/2 is finished with initialization by the DosTestPSD API; therefore, the PSD developer must be careful not to use any Init mode only PSD help's in this function.
 * The function is required for OS/2 to operate properly, so the function can not be omitted.
 * The function can call a PSD help that may block.

Example Code
 /*** Install - Install PSD * *   This function checks to see if this PSD is installable on the *   current platform. * *   ENTRY   pinstall - pointer to an INSTALL structure * *   EXIT    NO_ERROR - PSD Installed *           -1       - PSD not valid for this platform * */

ulong_t Install(INSTALL *pinstall) {

VMALLOC vmac; int i;  char *p; ulong_t rc = 0; char *ALR_String = "PROVEISA";

// _asm int 3;

/* Setup Global variables */

router = pinstall->pPSDHlpRouter; pParmString = pinstall->pParmString; pPSDPLMA = (void *)pinstall->pPSDPLMA; sizePLMA = pinstall->sizePLMA;

vmac.addr = BIOS_SEG << 4; vmac.cbsize = _64K; vmac.flags = VMALLOC_PHYS;

/* Map BIOS area */

if ((rc = PSDHelp(router, PSDHLP_VMALLOC, &vmac)) == NO_ERROR) {

/* Check for ALR string */ p = (char *)vmac.addr + ALR_STRING_OFFSET;

for (i = 0; ALR_String[i] != '\0'; i++) if (p[i] != ALR_String[i]) { rc = -1; break; }

/* Free BIOS mapping */ PSDHelp(router, PSDHLP_VMFREE, vmac.addr); }

return (rc); } 