## Display Device Driver Reference for OS/2

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

### Shared Data and Code between PM Drivers and Windows Drivers

Each design of seamless PM and Windows driver pairs requires its own shared data/code structure, because each driver implementation and its underlying video hardware are unique. The contents of the structure varies across implementations. The shared data/code structure for seamless XGA is included in the following example:

      PMDD_IO_STRUC  struc
       LevelID                 dd  ?  ; 4 bytes to sync interface to PMDD.

         ; The following variables are in the PM DD's default data segment.
         ulMemRegBase          dd  ?  ; 16:16 addr of memory mapped XGA regs
         usIORegBase           dw  ?  ; Base of IO XGA regs
         ulVramBase            dd  ?  ; 32-bit physical memory addr of VRAM
         ulVramSize            dd  ?  ; Size of VRAM in bytes
         bfUseExternalPolling  db  ?  ; TRUE if external polling is supported

         usScreenWidthMM       dw  ?
         usScreenHeightMM      dw  ?
         usScreenWidthPels     dw  ?
         usScreenHeightPels    dw  ?
         bBitsPerPel           db  ?

         pSemaphore            dd  ?  ; Flat pointer to FSRamSemaphore
         pHeartBeat            dd  ?  ; Flat pointer to heartbeat counter

         pNumDefaultColors     dd  ?  ; Flat ptr to # of default colors in use

         pCursorStatus         dd  ?  ; Byte ptr: bit 0x80 set if sfw cursor
         pExcludeCursor        dd  ?  ; 16:16 addr of exclude cursor function
         pDisableCursor        dd  ?  ; 16:16 addr of disable cursor function
         pEnableCursor         dd  ?  ; 16:16 addr of enable cursor function

         WindowsPrivateArea    db WINDOWS_PRIVATE_AREA_SIZE dup (?)
      ;------------------------------------------------------------------
      ; Information shared among the XGA Windows' drivers.
      ; Multiple Windows drivers can exist, running in multiple DOS sessions.
      ; SecondaryFontStart     dd  ?
      ; SecondaryFontEnd       dd  ?
      ;
      ; SystemFontTable        dd  256 dup (?)
      ; SecondaryFontTable     dd  256 dup (?)
      ;
      ; SystemFontHeight       dw  ?
      ; SystemFontPoints       dw  ?
      ; SystemFontWidth        dw  ?
      ; SystemFontCached       db  0
      ;
      ; SecondaryFontName      db  0
      ;                        db  32 dup (?) ; Max facename length=32.
      ;
      ; SecondaryFontNameLen   dw  1
      ; SecondaryFontHeight    dw  0
      ; SecondaryFontPoints    dw  0
      ; SecondaryFontWidth     dw  0
      ;
      ; SecondaryFontHdr       db  32 dup(0)
      ; SystemFontHdr          dw  16 dup(0)
      ; PaddedField            db  32 dup(0) ; Remaining reserved.
      ;------------------------------------------------------------------
      ; Total 2200 bytes reserved by the PM driver for Windows' drivers.

         bfPaletteIsFixed      db  ;  TRUE if palette manager not enabled
         ulLastPalUpdate       dd  ;  Timestamp of last foreground realize
         pHWPalette            dd  ;  16:16 ptr to HWPalette structure
         PMKWSPhysicalBase     dw  ;  Physical addr of 64KB kernel workspace for
                                   ;   bus-mastering into/out of system memory
         PMKWSLinearBAse       dd  ;  Linear addr of 64KB workspace

      PMDD_IO_STRUC ends

The initial entry in this shared structure must be a driver signature. For XGA, the signature is XG01. For VGA, the signature is VG01. This field must be checked by the Windows driver at initialization. If an incorrect entry is found, the Windows driver must report initialization failure to the GDI. This mechanism prohibits the running of non-compatible seamless driver pairs (for example, using a VGA seamless windows driver with a Presentation Manager XGA driver).