On Mon, Apr 09, 2001 at 10:55:50AM -0700, John Clark wrote:
> Erik Mouw wrote:
> > On Mon, Apr 09, 2001 at 06:36:37AM -0700, Deja User wrote:
> > > Can I write a kernel driver using C++ classes.
> >
> > No.
> >
> > > Will the loader/insmod take care of calling the ctr for global
> > > objects in that case.
> >
> > No.
> >
> > For a more elaborate argument why not, see question 1.4 from the
> > linux-kernel mailing list FAQ: http://www.tux.org/lkml/#s1-4 .
> >
> > Erik
> 
> Since I walk in a few OS programming world... Apple has created
> this 'thing' called IOKit which does implement a C++ environment
> for drivers for their Mac OS X based on various pieces of *BSD.
> One of the arguements put forth, is that this would allow for much
> more 'flexiblity' in the future. However, it pretty much requires a
> re-write of everything.

Yes. It means that they have to rewrite their IOKit with each and every
release of the C++ compiler they use for their kernel. It's quite
normal for C++ compiler to break the ABI on purpose so the applications
will break on compile time instead of run time. If Apple wants to go
that way, let them go. One of the reasons Linux won't do C++ in the
kernel is that it will be a maintability nightmare.

> The two salient points are, in such an environment, unless there's
> a 'legacy driver object', no old drivers really are usable. And two,
> unless the 'open source' community takes up such a package,
> there will be little 'feedback' of future drivers based on IOKit
> (or equivalent...) into the community.

Maybe somebody will take it up, but certainly not the core kernel
developers. Until now no single argument has convinced the core
developers to support C++ in the kernel, so a patch to allow C++ in the
kernel will not be accepted.

> A couple of specific issues on C++ are, multiple inheritances,
> and something really stupid, symbol name demangling....

Name mangling is not stupid, it is necessary for overloading. It is
used to encode the type of the parameters and the return type in the
function name so each overloaded function gets a unique name (which is
necessary for the linker).

> I've been told that gcc 3, may define a name demangling
> method in perpetuiti, but I'm not really knowledgeable in
> those sorts of details, as I don't do much C++ programing
> except when absolutely forced to.

G++-3.0 will have an ABI that allows it to be backward compatible with
previous versions. This new ABI will start at g++-3.0, so it will not
be backwards compatible with older g++ versions. Only newer versions of
g++ will be compatible with g++-3.0, but again, not earlier.

Anyway, we're getting off topic. I don't feel like repeating the C++
thread on this list. It turns up every six months on the linux-kernel
mailing list, so jump in the discussion on that list if it reappears.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: [EMAIL PROTECTED]
WWW: http://www-ict.its.tudelft.nl/~erik/

_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to