Linux device driver using c++!
Quoted 3 lines · Jinu
Is there someway I can make use of a OS independent C++ code. This code has classes, new, delete etc.. My plan was to build a static library using the C++ code and then write a simple OS interface module which has the init, cleanup, read, write, ioctl etc but calls C++ functions in the library.
Is this scenario possible?
Sure, just port it to C.
Seriously, you can do it in C++, but you'll hate yourself afterwards, and nobody in the Linux community will support you when you have problems. C++ just does not mix well with the Linux kernel. This is not a shortcoming of the Linux kernel; this is a fairly well-founded design decision, discussed to death once every six months.
If you do decide to pursue it, do it in a way that does
not require any patches to the kernel source, and please
do NOT submit any patches related to this to the linux kernel mailing list.
- Dan