C++ code in a kernel module?
Justin C. Walker
justin at mac.com
Tue Sep 9 09:08:26 PDT 2003
On Tuesday, September 9, 2003, at 08:58 AM, John Giacomoni wrote:
>
> On Tuesday, Sep 9, 2003, at 00:29 America/Denver, Peter Jeremy wrote:
>
>> On Mon, Sep 08, 2003 at 11:12:59PM -0400, Alexander Kabaev wrote:
>>> On Mon, 8 Sep 2003 23:02:33 -0400
>>> "Matthew Emmerton" <matt at compar.com> wrote:
>>>
[snip]
> simple, I have preexisting C++ code which we are currently
> using in userland and wish to push down into the kernel.
>
> It would be ideal to keep the source bases the same without
> a rewrite to C. Admitting of course the possibility of having
> to modify to be compatible with both use modes.
>
> At present I am attempting to see what we can and cannot do
> in the kernel with C++
FWIW, Darwin (the underpinnings for Mac OS X) uses C++ for its device
drivers. This is done by hewing to a model roughly that of "Embedded
C++", compiling statically, and having a separate library that differs
from libstdc++ in significant ways. Getting this to work well was
non-trivial, but it does work (sadly :-}).
If you are trying to get user-mode code to work in the kernel, you are
in for an enjoyable year...
You can check Apple's Darwin site for available doc
(http://developer.apple.com/darwin). The code is available under
Apple's open source license (APSL 2.0).
Regards,
Justin
--
/~\ The ASCII Justin C. Walker, Curmudgeon-at-Large
\ / Ribbon Campaign
X Help cure HTML Email
/ \
More information about the freebsd-hackers
mailing list