General Design and Implementation Strategies
To design an effective Windows NT display driver, consider the following
suggestions and facts:
-
Start with a DDK sample display driver written for a video adapter similar to
the adapter for which you are writing the driver. It would probably reduce
driver design time to modify one of the existing sample drivers rather than
write one from scratch.
-
For maximum portability, write as much of the driver as possible using the C
language. Use assembly language only when necessary for time-critical
operations that are not well supported by video adapter hardware. Coding in
assembly, while offering the possibility of optimization, is time-consuming
and removes the possibility of portability.
-
Use miniport drivers for operations that involve resource management, physical
device memory mapping, ensuring that register outputs occur in close
proximity, or responding to interrupts. The main purpose of miniport drivers
is to handle hardware variations within a family and to minimize display
driver hardware-type dependencies.
-
The display driver is in the same privileged kernel-mode address space as the
rest of the Windows NT Executive. Faults in the display driver will cause GDI
and the rest of the system to fault.
-
Display drivers (and video miniport drivers) are fully preemptable at any
time.
-
Both the code and data sections of a display driver are entirely pageable.
-
Exported functions must execute the standard Windows NT prolog on entry and
the epilog on exit. For more information, see the Win32 SDK.