Boost logo

Boost :

Subject: Re: [boost] [linux drivers] Is it possible to use boost in a Linux driver?
From: Bo Persson (bop_at_[hidden])
Date: 2009-01-14 12:28:56


Olaf Peter wrote:
>> Does anybody know if it's possible to use boost within a Linux
>> driver?
>
> short answer - from principle point of view: yes.
>
> A longer answer: probably without the full set of c++ language
> features.
> This means no exception handling (EH), no rtti. Some years ago I
> wrote a
> c++ kernel module (2.4.x). You have to write some stub for the c++
> specific linker symbols from g++ e.g. __ctor, __dtor etc. There
> where
> some discussion on net about c++ modules inside linux kernel. You
> have
> to google for it. The problem is the c++ runtime library and some
> general problems, e.g. how to handle uncaught exceptions? kernel
> panic?
> not a real solution - therefore no EH.
>

Or, to quote from the linked page

# Is it a good idea to write a new driver in C++# Is it a good idea to
write a new driver in C++?
The short answer is no, because there isn't any support for C++
drivers in the kernel.

# Why not add a C++ interface layer to the kernel to support C++
drivers?
The short answer is why bother, since there aren't any C++ drivers for
Linux.

So, you cannot write a driver in C++ because it isn't supported. Linus
is very happy with that.

Bo Persson


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk