The three major problems that occur when you develop a device driver in C are as follows:
- The .EXE file loader is in COMMAND.COM which is not available when MS-DOS loads a device driver. Therefore, a device driver must be the binary image of a single-segment program. Microsoft C/C++ version 7.0 introduced the ability to generate code in the tiny memory model in which the application stores its code and data in one memory segment.
- The C run-time initialization code requires an appropriate PSP (program segment prefix) and requires MS-DOS to be available. Even though the source code to the startup code is provided with the C compiler, most of the startup code is in assembler and would require major modifications to be useful in a driver.
- The entry-exit sequences used by C functions are inappropriate for use in an MS-DOS driver.
ID d'article : 3999004 - Dernière mise à jour : 1 déc. 2003 - Révision : 1