The S3 driver supports multiple resolutions and color depths that are contained in a single driver. To change resolutions, the user selects the resolution from a page in the Settings notebook for the System setup object. (Making a selection is easier than reinstalling new drivers for each resolution or color depth.) The key to this capability is a documented driver entry point at ordinal 202. At 8514_32.def, the ordinal 202 is used by OS2_PM_DRV_QUERYSCREENRESOLUTIONS. After searching, this function is found in the EDDQSRES.C file.
To obtain the resolutions supported by the video driver, exported entry 202 is called by the system's Settings notebook page. This function copies back to the caller the asr[] array created in the EDDESRES.C file. Those entries that have the asr[]floptions flag DSP_RESOLUTION_OBTAINABLE, will be available for a user to select from the Settings notebook. The asr[] array is initialized in SetObtainableModes(), in the MODEINFO.C file, as part of the driver initialization process. When this array is copied back to the caller, the user chooses one of the resolutions given, and upon restarting OS/2, the driver brings up the new resolution.
The exported entry point at ordinal 202 gives a mechanism for the driver to tell the Settings notebook which resolutions it supports. By way of OS2.INI, the Settings notebook can tell the display driver which resolution was selected. Installing the S3 driver adds and modifies a number of keys in OS2.INI. The following keys are added under PM_DISPLAYDRIVERS:
Key
The added keys sets the S3 presentation driver DLL to be the current driver, and is the same procedure used for installing the SVGA driver. However, the system's Settings notebook adds an additional key called DEFAULTSYSTEMRESOLUTION. This key has as its value, a data structure of type SCREENRESOLUTION, which corresponds to an entry in the asr[] array. Based on which resolution is chosen, the value of the key is set. Upon initialization, in QueryAndSelectNativeMode, the display driver calls the function Get_User_Mode() (EDDESRES.C). Get_User_Mode reads the DEFAULTSYSTEMRESOLUTION key from OS2.INI, and returns the structure. The DEFAULTSYSTEMRESOLUTION key value gives the driver the display height, width, and color depth that the user has chosen.
Changing the resolution by way of the Settings notebook (namely, editing SYSTEM.INI) is accomplished by some keys in OS2.INI, so that the correct WINOS/2* drivers are installed. The following is a portion of S3.DSP (the dspinstl installation script for the S3 driver):
OS2.INI PM_DISPLAYDRIVERS RESOLUTION_CHANGED 1 WIN_RES_640x480x16 WIN_RES_SET WIN_RES_S3_0 WIN_RES_640x480x256 WIN_RES_SET WIN_RES_S3_1 WIN_RES_640x480x65536 WIN_RES_SET WIN_RES_S3_2 WIN_RES_800x600x256 WIN_RES_SET WIN_RES_S3_3 WIN_RES_800x600x65536 WIN_RES_SET WIN_RES_S3_4 WIN_RES_1024x768x256 WIN_RES_SET WIN_RES_S3_5 WIN_RES_1024x768x65536 WIN_RES_SET WIN_RES_S3_6 WIN_RES_1280x1024x256 WIN_RES_SET WIN_RES_S3_7 WIN_RES_640x480x16777216 WIN_RES_SET WIN_RES_S3_8 WIN_RES_S3_0 1 "system.ini boot sdisplay.drv swinvga.drv" WIN_RES_S3_0 2 "system.ini boot display.drv vga.drv" WIN_RES_S3_0 3 "system.ini boot fonts.fon vgasys.fon" WIN_RES_S3_0 4 "system.ini boot fixedfon.fon vgafix.fon" WIN_RES_S3_0 5 "system.ini boot oemfonts.fon vgaoem.fon" WIN_RES_S3_0 6 "win.ini fonts \"Symbol %ANYSTRING%\" WIN_RES_S3_0 7 "win.ini fonts \"Helv %ANYSTRING%\" WIN_RES_S3_0 8 "win.ini fonts \"Tms Rmn %ANYSTRING%\" WIN_RES_S3_0 9 "win.ini fonts \"Courier %ANYSTRING%\" WIN_RES_S3_0 10 "win.ini fonts \"MS** Sans Serif %ANYSTRING%\" WIN_RES_S3_0 11 "win.ini fonts \"MS Serif %ANYSTRING%\" WIN_RES_S3_0 12 "win.ini fonts \"Small Fonts %ANYSTRING%\" WIN_RES_S3_0 13 "win.ini fonts \"MS Sans Serif 8,10,12,14,18,24 (VGA res)\" WIN_RES_S3_0 14 "win.ini fonts \"Courier 10,12,15 (VGA res)\" WIN_RES_S3_0 15 "win.ini fonts \"MS Serif 8,10,12,14,18,24 (VGA res)\" WIN_RES_S3_0 16 "win.ini fonts \"Symbol 8,10,12,14,18,24 (VGA res)\" WIN_RES_S3_0 17 "win.ini fonts \"Small Fonts (VGA res)\"
When the resolution is changed, the RESOLUTION_CHANGED key is added by the Settings notebook to OS2.INI. When the presentation display driver is restarted, this flag in OS2.INI is checked. If it is 1, OS/2 examines the WIN_RES_xxx_yyy_bbb key that corresponds to the value of DEFAULTSYSTEMRESOLUTION. Each of these strings in OS2.INI have a single key called WIN_RES_SET, with a value that gives the name of another string in OS2.INI. For example, WIN_RES_S3_0 has 17 keys. Key number 1 installs the line "sdisplay=swinvga.drv" in the "boot" section of SYSTEM.INI. OS/2 iterates through these keys, and edits the appropriate sections of SYSTEM.INI or WIN.INI, based on the value of each key.
Although the S3 driver does not look at the WINOS/2 .INI files, it is possible to use the WIN_RES_XXX values to create the entries for the WIN.INI or SYSTEM.INI that are queried by the WINOS/2 driver during its initialization. For example:
WIN_RES_S3_0 18 "system.ini s3 width 640" WIN_RES_S3_0 19 "system.ini s3 height 480" WIN_RES_S3_0 20 "system.ini s3 bpp 16" WIN_RES_S3_0 20 "system.ini s3 dpi 96"
Adding the above entries to the fragment of S3.DSP (S3.DSP (Sample File for Installation and Configuration)) creates the following entry in SYSTEM.INI when 640 x 480 16-color mode is selected:
[s3] width=640 height=480 bpp=16 dpi=96
When changing the dspinstl script, refer to S3.DSP (Sample File for Installation and Configuration) for information.