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 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,--dwarf1
Debugging 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.
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005