DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing drivers in C++

Compiling, linking, and debugging

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 UnixWare 7 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 UnixWare 7 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,--dwarf1
Debugging tools such as kdb and scodb that show symbolic information will show C++ names in their mangled state. Use the c++filt(1C++) command to demangle them.
© 1999 The Santa Cruz Operation, Inc. All rights reserved.
HDK 7.1.0 - June 1999