A Sample GRE22 Hardcopy Driver
The C source code for MiniDriver2 is provided on the Device Driver Source Kit for OS/2 CD-ROM. The following are some MiniDriver2 facts:
- MiniDriver2 is a minimal hardcopy driver that uses GRE22.
- MiniDriver2 takes a pure raster approach to printing; that is, it replaces only those mandatory functions in the dispatch table and leaves all drawing to GRE and Softdraw.
- MiniDriver2 will drive an HP LaserJet III or compatible printer, which means that it contains device-specific code. All device-specific code is marked with an eyecatcher: DEVICE_SPECIFIC. Use a search utility to locate these sections of code.
- MiniDriver2 is specific to GRE Version 0x0220. It will not run on OS/2 2.1 nor 2.11 because they shipped with an earlier GRE version. However, GRE Version 0x0220 is the minimum GRE level for OS/2 for PowerPC, so MiniDriver2 is a starting point for developing printer drivers for the PowerPC version of OS/2.
- MiniDriver2 does not replace Softdraw BitBlt and Line functions, so it must allocate memory for Softdraw output. See ESCAPE.C.
- MiniDriver2 links with the Generic Printer Library (GPL), GENPLIB.LIB. GPL is a set of common routines for printer drivers. MiniDriver2 uses the banding routines in GPL.
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation