## MMPM/2 Device Driver Reference

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

### Step 2. Modifying the CARDINFO.RC File

The CARDINFO.RC file is located in the \MMOS2\MMTOOLKT\SAMPLES\VIDINST subdirectory. Modify this file so that it contains information relevant to your video adapter. MMPM/2 uses this information to interface with the adapter.

Notes:

1.The lines in this file that contain RCDATA, BEGIN, and END identify the beginning and ending of specific pieces of data. Do not change these lines.

2.If more than one adapter is added, increment each RCDATA number by 10 for each additional adapter. For example, the first adapter uses RCDATA 10 through RCDATA 19, the second adapter uses RCDATA 20 through RCDATA 29, and so forth.

3.If the video adapter does not have a value corresponding to one of the CARDINFO.RC file parameters, use a null string "/0" in the parameter.

The CARDINFO.RC parameters are:

RCDATA 1 Indicates the number of adapters described in this CARDINFO.RC file. In most cases, this is 1. To install more than one type of video adapter, place that number in this parameter.

For example, in the CARDINFO.RC file, the Video Blaster adapter is:

    RCDATA 1
    BEGIN
       "1"           /* Number of adapters in this rc file   */
    END

RCDATA 10 Contains two parameters, the ID number and type of adapter used in the CONTROL.SCR file. The ID number can be any number. However, it must match the ssdllinputparms keyword in the CONTROL.SCR file that is modified in Step 6. Modifying the CONTROL.SCR File. For the type of adapter, the only valid value is "vca."

For example, in the CARDINFO.RC file, the Video Blaster adapter is:

    RCDATA 10
    BEGIN
       "33",            /* ID number of this adapter */
       "vca"            /* Type of adapter           */
    END

RCDATA 11 Contains parameters that indicate:

The maximum number of this type of video adapter that can be installed at one time. The maximum is six adapters.

The name of the help file that describes the video adapter. This name defaults to VIDHELP.HLP if the MAKEFILE provided to create the help file is used.

The name of the video-adapter-specific DLL you wrote to perform functions not provided by this generic video installation program. This DLL is described in Step 3. Creating a Video Installation DLL. If you did not write a DLL, specify "\0."

The name of the video-adapter-specific DLL entry point into the DLL in the previous field. If you did not write a DLL, specify "\0."

The number of CONFIG.SYS lines to add to the user's CONFIG.SYS file to support the video adapter. The maximum is six lines.

The CONFIG.SYS line format of the lines added to the user's CONFIG.SYS file. Tokens in this line are replaced with the appropriate values at runtime. The following list describes the tokens and their data substitutions:

*PATH* Indicates the path where MMPM/2 was installed (for example, c:\MMOS2 ).

*ORD* Indicates the device ordinal of this adapter.

*SEQ* Indicates the sequential number of this adapter. For example, if the user installs two IBM video capture adapters, the first will have a number of 1 and the second a number of 2.

*PDD* Indicates the PDDName of this adapter.

*VAL* Indicates the values that the user gives when prompted by the installation program. You can have more than one of these tokens if the user is asked for more than one item.

Note: Later in the CARDINFO.RC file, you specify which questions the install program should ask.

*SPEC* Indicates special values passed from your adapter-specific DLL.

For example, the line in the sample CARDINFO.RC file is:

"DEVICE=*PATH*\\VIDVBC.SYS /*VAL* /*VAL* /*VAL* /*SEQ*"

After the real values are substituted, the CONFIG.SYS line is similar to:

DEVICE=C:\MMOS2\VIDVBC.SYS /0F00000 /2AD6 /I5 /1

The number of drivers to install into the MMPM/2 system. For a video capture adapter, this would normally be 1 because a Digital Video driver is the only driver installed. The maximum is six drivers.

The name of the adapter as it is displayed to the user.

The version number of the device driver.

The physical device driver name (PDDName) used to identify the device driver. The sequential number of the adapter and a "$" is added to this name to form the final PDDName. For example, if the user installs two Video Blaster** Adapters, the PDDNames are VIDVBC1$ and VIDVBC2$.

The name of the MCD command table used by the drivers. In most cases, this is the IBM MCD command table 'MDM'.

The name of the VSD command table used by the drivers. In most cases, this is blank.

For example, in the CARDINFO.RC file, the Video Blaster adapter is:

    RCDATA 11
    BEGIN
       "1",                        /* Max number of adapters (2 chars)  (6 max)  */
       "vidhelp.hlp",              /* Helpfile name (19 chars)                   */
       "\0",                       /* Adapter specific dll name (19 chars)       */
       "\0",                       /* Adapter specific dll entry point (39 chars)*/

       /**** Data for CONFIG.SYS **/
       "1",                        /* Number of CONFIG.SYS lines (1 char)        */
       "DEVICE=*PATH*\\VIDVBC.SYS /*VAL* /*VAL* /*VAL* /*SEQ*",
                                   /* CONFIG.SYS Line 1                          */
                                   /* (255 chars after token substitution)       */

       /**** Data for INI File ****/
       "1",                        /* Number of Drivers to Install (1 char)      */
       "Video Blaster",            /* Product name (39 chars)                    */
       "1.0.0",                    /* Version of the adapter's software (6 chars)*/
       "VIDVBC",                   /* PDD Name  (5 chars)                        */
       "MDM",                      /* MCD table name (19 chars)                  */
       "\0"                        /* VSD table name (19 chars)                  */
    END

RCDATA 12 This group of parameters is repeated for each driver you want to install. The repeated groups should start with RCDATA 13, RCDATA 14, and so forth. These parameters indicate:

The InstallName of this driver. This must be a unique name. Consider using a name that is a combination of a company name, device type, and device model. The sequential number of this adapter is added to the name (for example, IBMDIGVIDCVB01).

The device type encoding. These codes are defined in the MCIOS2.H file located in the \MMOS2\MMTOOLKT\H subdirectory.

The numeric device flag of this driver. Specifies the LONG INT with the flags set. This determines whether or not the device is controllable. The device flags are defined in the MCIOS2.H file located in the \MMOS2\ MMTOOLKT\H subdirectory.

The name of the media control driver (MCD) used by this driver. In most cases, this is the IBM MCD 'SVMC'.

The name of the vendor-specific driver (VSD) used by this driver. In most cases, this is the IBM VSD 'VIDVCI'.

The numeric share type. Specifies an encoding of the valid types of sharing supported. These codes are defined in the MMDRVOS2.H file located in the \MMOS2\MMTOOLKT\H subdirectory.

The name to be given to this driver's resources. Specifies a unique name for the management for the driver resources. The sequential number of the adapter is added to this name so that resources of different drivers are not mixed. If you have more than one driver, be sure to use a different name for each driver. For more information, see Resource Units and Classes.

The number of resource units supported by this driver. For more information, see Resource Units and Classes.

The number of resource classes supported by this driver. The maximum is nine resource classes. These classes are listed in the next field. For more information, see Resource Units and Classes.

The resource classes. For more information, see Resource Units and Classes .

The number of valid combinations of resource classes. For more information , see Resource Units and Classes.

The valid resource class combinations. Resource class combinations are always listed in pairs.

Note: This field is not in the sample because Video Blaster does not have any valid resource class combinations. If it did, the combination would be listed similar to this:

    "1","2",    (One combines with two)
    "2","1",    (Two combines with one)

For more information, see Resource Units and Classes.

The number of connectors. These are listed in the next field. The maximum is 10 connectors. Each implementation of a media driver defines the paths of information flow into and out of the device. These paths are known as connectors. Connectors have defined connector types, and each connector type has an associated connector-type name.

The connectors. Each connector has three values:

-Numeric type of connector. Connection types are defined in the MCIOS2.H file located in the \MMOS2\MMTOOLKT\H subdirectory.

-InstallName of the driver to which it connects. If left blank, a default connector is used.

-Sequential number of the connector to which it connects.

The sample CARDINFO.RC file uses:

"3","","1"

where:

3 Indicates the wave stream connector.

"" Indicates the default WaveAudio device.

1 Indicates the first connector of the WaveAudio device.

The number of file-name extensions associated with this driver. When an element name is specified as the device name on an MCI_OPEN message and no device type is specified, the device type is identified by the file extension. For example, if the .AVI extension is associated with an internal driver name, that driver will be used if a file ending in .AVI is opened.

The file-name extensions associated with this driver.

Note: This field is not used in the sample because no extensions are associated with the driver for Video Blaster. If there were extensions, they would be listed like the following:

"AVI", "AVS"

The extended attribute associated with this driver. When an element name is specified as the device name on an MCI_OPEN message and no device type is specified, the device type is identified by the files extended attribute . For example, if the "Digital Video" extended attribute is associated with an internal driver name, that driver will be used if a file with an extended attribute of "Digital Video" is opened.

The AliasName given to the driver. This is an alternate name given to the driver. The device ordinal is added to this name if the ordinal is greater than 1. For example, the second DigitalVideo device would be given an AliasName of Digital Video 2.

Any device specific parameters. These parameters allow you to provide additional information about the driver to the MCD. In most cases, this is blank.

For example, in the CARDINFO.RC file, the Video Blaster adapter is:

    RCDATA 12
    BEGIN
       /**** DIGITAL VIDEO Driver ****/
       "IBMDIGVIDCVB",             /* Installname (17 chars)                     */
       "12",                       /* Device type (3 chars)                      */
       "1",                        /* Device flag (3 chars)                      */
       "SVMC",                     /* MCD driver name (19 chars)                 */
       "VIDVCI",                   /* VSD driver name (19 chars)                 */
       "3",                        /* Share Type (3 chars)                       */
       "Video Blaster",            /* Resource name (17 chars)                   */
       "10",                       /* # of Resource units (2 chars)              */
       "2",                        /* # of Resource classes (2 chars)            */
       "10","1",                   /* Resource classes (2 char each)             */
       "0",                        /* # Valid resource class combos (2 chars)    */
       /* No combos */             /* Valid resource class combos (2 chars each) */
       "1",                        /* # of connectors  (2 chars)                 */
       "3","","1",                 /* Connectors (2 chars), (17 chars), (2 chars)*/
       "0",                        /* # of extensions (2 chars)                  */
       /* no extension names */    /* Extension names  (3 chars each)            */
       "\0",                       /* Extended attribute (255 chars)             */
       "Digital Video",            /* Alias Name (17 chars)                      */
       "\0"                        /* Device Specific Parameters (255 chars)     */
    END

RCDATA 19 This group of parameters indicate:

The number of prompts that should be presented to the user. This number is used to gather configuration-specific information about the user's adapter. The maximum is 10 prompts.

The title of the prompt text as it is displayed to the user.

The number of valid answers to the prompt. The maximum is 25 answers. You supply the valid answers in the next field.

The valid answers to your prompt. These answers are displayed to the user . The user can select one.

The values that are put in your CONFIG.SYS line. These values replace the *VAL* tokens that you placed in your CONFIG.SYS line format previously in this CARDINFO.RC file. These values correspond to the valid answers in the previous field. For example, if the user selects answer number three from the list of valid answers, then value number three is placed into your CONFIG.SYS line. This allows you to ask the user questions in a user- friendly fashion and then place a more cryptic value in the CONFIG.SYS line .

For example, you can ask the user if they want to run a hardware test on startup with the following prompt:

    Run hardware test on startup?

The valid answers that you present to the user could be:

    Yes

    No

The valid values that could be put into the CONFIG.SYS line could be "test" or "notest."

The default answer to the prompt. This is an index into the list of valid answers. For example, if the first answer is the default, specify "1." For an example of how to specify the RCDATA 19 parameters for this example, see Startup Example.

For example, in the CARDINFO.RC file, the Video Blaster adapter is:

    RCDATA 19
    BEGIN
       // Prompts for the User
       "3",                        /* # Number of prompts to ask user (3 chars)  */
                                   /* (max 10 prompts)                           */
       // Prompt 1
       "Frame Buffer Base Address",/* Title of Prompt (max 50 chars)             */
       "8",                        /* # of valid values (2 chars)                */
       "0F00000",                  /* Valid values  (20 chars each)              */
       "0E00000",
       "0D00000",
       "0C00000",
       "0B00000",
       "0A00000",
       "0900000",
       "0800000",
       "1",                        /* Default value - Index into valid values    */
                                   /* (2 chars)                                  */

       // Prompt 2
       "Base I/O Address",         /* Title of Prompt (max 50 chars)             */
       "3",                        /* # of valid values (2 chars)                */
       "2AD6",                     /* Valid values (20 chars each)               */
       "2A90",
       "2AF0",
       "1",                        /* Default value - Index into valid values    */
                                   /* (2 chars)                                  */

       // Prompt 3
       "Interrupt",                /* Title of Prompt (max 50 chars)             */
       "4",                        /* # of valid values (2 chars)                */
       "I5",
       "I10",                      /* Valid values (20 chars each)               */
       "I11",
       "I12",
       "2"                         /* Default value - Index into valid values    */
                                   /* (2 chars)                                  */
    END