## Graphics Adapter Device Driver Reference

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

### Sample .PMI File Using Imported PMI Binary Object

This section diagrams a sample .PMI file. The sample file is shipped by a chip-set vendor and supports a number of adapter implementations of the vendor's chip set. All of the adapter-specific functions are handled by the imported PMI functions from the VENDOR.DLL dynamic link library. The adapter-specific [Hardware] section, which provides the description for the specific implementation identified on the user's machine, is provided in the VENDOR.PMI Include file.

Thus, by copying different Include files, together with the master SVGADATA .PMI and VENDOR.DLL files, specific adapter installation is covered with minimum investment in a utility for formatting the .PMI file.

The generic PMI file lists all of the modes possible, with the maximum memory configuration for the chip. It also lists reasonable timing limits per mode that should be supported by all adapters. This information provides the filtering service to the configuration utility, which presents the timing choices to the user. Should a particular adapter's capabilities be lower than the timing values set, the SetMonitorTimings function should perform verification of the input parameters in order to protect the hardware. If the adapter's capabilities vary greatly, the PMI file should be formatted to reflect the correct MonitorModeInfo for the adapter.

    /*
    ** Vendor include PMI file VENDOR.PMI
    */
    BusType             = ADAPTER_BUS_TYPE
    OEMString           = "CHIPSET_NAME ADAPTER_NAME, ADAPTER_MANUFACTURER_NAME"
    DACString           = "DAC_MANUFACTURER_NAME, DAC_NAME"
    Version             = "3.2"
    TotalMemory         = ACTUAL_VRAM_MEMORY_SIZE
    MemoryIOAddress     = MMIO_ADDRESS
    PortIOAddress       = PIO_ADDRESS
    Endian              = LITTLE

    /*
    ** Generic PMI file
    */
    [PMIVersion]        2.2
    #includecode        "vendor.DLL"   //exports all fnPMI entry points used
    in this PMI file
    #include            "vendor.pmi"

    /*
     *        List of declared ports. Required if adapter is dynamically
     *        configurable
    */
    [Declarations]
    MRegisterA =MMIO{0x00180298}
    ...
    /*
     *    List of I/O and MMIO ports to be trapped
    */

    [TrapRegs]
    DWORD_MMIOPORT RW ACCEL MRegisterA;
    ...

    [EnableController]
    call fnPMIEnableController;

    [DisableController]
    call fnPMIDisableController;

    [UnLock]
    call fnPMIUnlock;

    [Cleanup]
    call fnPMICleanup;

    [GetBank]
    call fnPMIGetBank;

    [SetBank]
    call fnPMISetBank;

    [SetMonitorTimings]
    call fnPMIProgramTimings;

    [TuneDisplay]
    call fnPMITuneDisplay;

    [comment]
    Graphics Mode: 640 x 480 x 16 colors.
    [ModeInfo]
    ModeAttributes      = 0x18
    BytesPerScanLine    = 640
    XResolution         = 640
    YResolution         = 480
    TextRows            = 30
    BitsPerPixel        = 4
    NumberOfPlanes      = 4
    PageLength          = 38400
    SaveSize            = 153600
    Int10ModeSet        = 0x012
    BufferAddress       = 0x000a0000
    ApertureSize        = 0x00010000
    [MonitorModeInfo]
    VerticalRefresh     = 72
    HorizontalRefresh   = 38
    ScreenLeftEdge      = 0x00000021
    ScreenRightEdge     = 0x000000C1
    ScreenTopEdge       = 0x00000019
    ScreenBottomEdge      =   0x000001F9

    [ comment ]
    Graphics   Mode :   640   x   480   x   256   colors .
    [ ModeInfo ]
    ModeAttributes        =   0x18
    BytesPerScanLine      =   640
    XResolution           =   640
    YResolution           =   480
    TextRows               =   30
    BitsPerPixel          =   8
    NumberOfPlanes        =   1
    PageLength            =   307200
    SaveSize               =   307200
    BufferAddress         =   LinearWindowAddress
    ApertureSize          =   0x00200000
    [ MonitorModeInfo ]
    VerticalRefresh       =   72
    HorizontalRefresh     =   38
    ScreenLeftEdge        =   0x00000021
    ScreenRightEdge       =   0x000000C1
    ScreenTopEdge         =   0x00000019
    ScreenBottomEdge      =   0x000001F9

    [ comment ]
    Graphics   Mode :   640   x   480   x   64K   colors .
    [ ModeInfo ]
    ModeAttributes        =   0x18
    BytesPerScanLine      =   1280
    XResolution           =   640
    YResolution           =   480
    TextRows               =   30
    BitsPerPixel          =   16
    NumberOfPlanes        =   1
    PageLength            =   614400
    SaveSize               =   614400
    ColorFormat           =   " RGB "
    ColorWeight           =   " 5 : 6 : 5 "
    BufferAddress         =   LinearWindowAddress
    ApertureSize          =   0x00200000
    [ MonitorModeInfo ]
    VerticalRefresh       =   72
    HorizontalRefresh     =   38
    ScreenLeftEdge        =   0x00000021
    ScreenRightEdge       =   0x000000C1
    ScreenTopEdge         =   0x00000019
    ScreenBottomEdge      =   0x000001F9

    [ comment ]
    Graphics   Mode :   800   x   600   x   256   colors .
    [ ModeInfo ]
    ModeAttributes        =   0x18
    BytesPerScanLine      =   800
    XResolution           =   800
    YResolution           =   600
    TextRows               =   37
    BitsPerPixel          =   8
    NumberOfPlanes        =   1
    PageLength            =   480000
    SaveSize               =   480000
    BufferAddress         =   LinearWindowAddress
    ApertureSize          =   0x00200000
    [ MonitorModeInfo ]
    VerticalRefresh       =   72
    HorizontalRefresh     =   48
    ScreenLeftEdge        =   0x0000002B
    ScreenRightEdge       =   0x000000F3
    ScreenTopEdge         =   0x0000001D
    ScreenBottomEdge      =   0x00000275

    [ comment ]
    Graphics   Mode :   1024   x   768   x   256   colors .
    [ ModeInfo ]
    ModeAttributes        =   0x18
    BytesPerScanLine      =   1024
    XResolution           =   1024
    YResolution           =   768
    TextRows               =   48
    BitsPerPixel          =   8
    NumberOfPlanes        =   1
    PageLength            =   786432
    SaveSize               =   786432
    BufferAddress         =   LinearWindowAddress
    ApertureSize          =   0x00200000
    [ MonitorModeInfo ]
    VerticalRefresh       =   72
    HorizontalRefresh     =   58
    ScreenLeftEdge        =   0x00000041
    ScreenRightEdge       =   0x00000141
    ScreenTopEdge         =   0x00000021
    ScreenBottomEdge      =   0x00000321

    [ SetMode ]
    call   fnPMISetMode ;
    [ comment ]
    Text   Mode :   80   cols ,   25   rows .
    [ ModeInfo ]
    ModeAttributes        =   0x08
    BytesPerScanLine      =   80
    XResolution           =   720
    YResolution           =   400
    XCharSize              =   9
    YCharSize              =   16
    TextRows               =   25
    BitsPerPixel          =   4
    NumberOfPlanes        =   1
    PageLength            =   4000
    SaveSize               =   4000
    Int10ModeSet          =   0x003
    VerticalRefresh       =   60
    BufferAddress         =   0x000b8000
    ApertureSize          =   0x00008000

    [ SetMode ]
    call   fnPMISetTextMode ;