> In message <[EMAIL PROTECTED]> Thierry writes:
> : We are implementing our OS modem on FreeBSD, but lot of our sources
> : have writen in C++. Is it possible to compile the FreeBSD kernel in
> : C++ to include our driver ?
>
> Yes and No.
>
> If you use only the bare minimal subset of features for the C++ and
> avoid the problem areas of the language, you might be able to. But
> you'd have to add new and delete support to the kernel's library.
> That should be almost trivial.
>
> The problem areas definitely include exceptions, some automatic memory
> allocation (where temporary variables are malloced), large objects
> appearing on the stack (because the kernel stack is so small). I
> don't know if ctors for static objects would be called in the kernel.
> Templates might also be a problem, but they might not.
I'll second the "doability" of this. I've been going through some
C++ work in an embedded system. Exceptions had already been given
up on. The ctors/dtors are handled with "munch" style tools
(from vxWorks land) that generate construct/destruct
vectors that you'll probably then hook in with kernel modules.
Peter
--
Peter Dufault ([EMAIL PROTECTED]) Realtime development, Machine control,
HD Associates, Inc. Fail-Safe systems, Agency approval
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message