The first hardware-dependent task in a PM driver is to initialize the video hardware and set it into a graphics mode. This is slightly more complicated with the S3 driver than with the SVGA driver (as an example) because the S3 driver supports multiple resolutions and color depths. The following is the logical sequence of functions in the driver that perform initialization, followed by commentary about them. There is more to initialization of the driver than what is shown below, but most of what is not covered is not hardware-dependent. (Refer to the OS/2 Presentation Device Driver Reference for further information.)
OS2_PM_DRV_ENABLE() - eddenabl.c EXPORT @200 FillLdb() - Fill Logical Device Block (eddefldb.c) if (first_time) { FillPdb() - Fill Physical Device Block (eddefpdb.c) QueryAndSelectNativeMode() - (eddesres.c) Determine adapter memory size SetObtainableModes() - (modeinfo.c) Get_User_Mode() DMS32CallBack((PFN) SwitchToChosenMode) KlugeReset() - (hwaccess.asm) CacheManager() - (cacheman.c) SwitchToExtendedGraphicsMode() - (setmode.c) DMS32CallBack((PFN) SwitchToChosenMode) KlugeReset() - (hwaccess.asm) InitialiseVRAM() - (eddevram.c) CreateFontCache() - (eddncach.c) InitialiseSeamless() - (seamless.c) initialise_bm_cache() - (eddncach.c) } GetVRAMPointer() Pass back pointers to driver functions