C++ in the kernel

Ali Mashtizadeh mashtizadeh at gmail.com
Sat Oct 27 12:35:56 PDT 2007


The Mac OS X I/O Kit has a fairly clean interface. I actually added a bit of
C++ support to my own FreeBSD Kernel a while back. If you drop exceptions
and RTTI it's fairly easy to implement. I didn't put much effort into making
any C++ API for drivers. I just used it so I could have object oriented code
in the backend of a drivers. I think it's not really worth it in most cases.

The L4 microkernel (http://l4ka.org/) has versions of its Kernel written in
C++ and they make extensive use of templates. That is probably the most
successful use of C++ in a Kernel I've seen.

Ali

On 10/27/07, Frank Mayhar <frank at exit.com> wrote:
>
> On Sat, 2007-10-27 at 05:25 +0100, Bruce M Simpson wrote:
> > I was wondering if anyone had done any further thinking about this.
>
> Have you looked at the Mac OSX I/O Kit?  It's entirely C++ (with some
> pretty stringent restrictions) and is really only used for device
> discovery.  As far as I'm concerned, it's just about the only
> appropriate use for C++ in the kernel and I would drop my support even
> for that if I were introduced to something better.  I haven't yet looked
> at K.
> --
> Frank Mayhar frank at exit.com     http://www.exit.com/
> Exit Consulting                 http://www.gpsclock.com/
>                                 http://www.exit.com/blog/frank/
>                                 http://www.zazzle.com/fmayhar*
> _______________________________________________
> freebsd-arch at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch-unsubscribe at freebsd.org"
>



-- 
Ali Mashtizadeh
علی مشتی زاده


More information about the freebsd-arch mailing list