Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2006 16:57:10 +0200
From:      des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=)
To:        mag@intron.ac
Cc:        freebsd-hackers@freebsd.org, Matthias Andree <matthias.andree@gmx.de>, delphij@delphij.net, Julian Elischer <julian@elischer.org>
Subject:   Re: kern/99979: Get Ready for Kernel Module in C++
Message-ID:  <86zmfg42bd.fsf@xps.des.no>
In-Reply-To: <courier.44B3B9A0.0000609C@intron.ac> (mag@intron.ac's message of "Tue, 11 Jul 2006 22:45:52 %2B0800")
References:  <200607092136.k69LaNDX055391@www.freebsd.org> <84dead720607092015q7f1701abse143f3855c2aa95a@mail.gmail.com> <1152540567.99616@origin.intron.ac> <44B2AE69.4080703@elischer.org> <44B2D2DF.2000401@sh.cvut.cz> <86sll8zl9x.fsf@xps.des.no> <courier.44B35DBC.00003F75@intron.ac> <86fyh8zgw8.fsf@xps.des.no> <courier.44B37714.00004B4D@intron.ac> <868xn0z8w9.fsf@xps.des.no> <courier.44B3B9A0.0000609C@intron.ac>

next in thread | previous in thread | raw e-mail | index | archive | help
mag@intron.ac writes:

> Dag-Erling  [iso-8859-1] Sm  grav wrote:
>
>> mag@intron.ac writes:
>>> But "-ffreestanding" doesn't work with C++.
>> While the C++ standard does define hosted and freestanding
>> implementations, its definition is different from (and less useful
>> than) that in the C standard.  For instance, the C++ standard requires
>> the existence of abort(), atexit() and exit() even in a freestanding
>> implementation.
>> Basically, one cannot indiscriminately use the same compiler flags
>> for
>> C and C++, because they are very different languages - far more
>> different than they seem on the surface.  Modern C++ is very poorly
>> suited for low-level code.
>
> Just as you said, C++ is more complicated than C. However, without
> C++ exception and other advanced features, it hasn't brought much
> complexity to C++ runtime library. Early C++ compiler even translates
> C++ code into C code before real compilation.

Several C++ compilers still do that, but that is irrelevant.  What is
relevant is the size and complexity of the runtime support library.

> For example, I think C++ exception handling is really poorly suited for
> low-level code.

Exception handling is required by the standard, even for freestanding
implementations.

> Is the "object model" described in FreeBSD Architecture Handbook?
> (http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/kernel-ob=
jects.html)

Yes.

> But the "object model" is still obscure to understand no matter how many
> people all over the world master C++.

The fact that you don't understand it doesn't mean it's bad.

> What's more, can the "object model" function really as OpenDarwin's
> IOKit class model?

Does it need to?

> Now, OpenDarwin has owned a C++-based kernel object model. But why
> cannot FreeBSD?

Look, if you want MacOS X, you know where to find it.

> Well, you can LOOK DOWN UPON me, but I believe you cannot throw doubt on
> FreeBSD's actuality: so weak USB support (kernel crash easier than many
> other OSs that we laughed at and that we are laughing at), so weak PCI
> device support.

Please provide references to the PRs you filed about these issues.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86zmfg42bd.fsf>