|
|
Except for what has been discussed in this paper, C++ device drivers are compiled and linked like a C driver; see ``Compiling kernel drivers''. See ``Packaging and installing SVR5 drivers'' for information about packaging drivers, and ``Driver testing and debugging'' for information about testing and debugging drivers.
For example, the same -D_KERNEL preprocessor definition is passed on the CC command line. After the ld -r -o Driver.o command is done, a C++ driver is installed with the standard tools such as idinstall -a, idbuild -M, and, for loadable DDI 7 drivers and all DDI 8 drivers, modbuild -l.
One difference for SVR5 is that, when using the scodb kernel debugger, you need to produce DWARF I debugging information rather than the default DWARF II debugging information. To do this, use the following compiler option:
CC -Wf,--dwarf1Debugging tools such as kdb and scodb that show symbolic information will show C++ names in their mangled state. Use the c++filt command to demangle them.