lkml.org 
[lkml]   [2000]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [Criticism] On the discussion about C++ modules
Date
Eray Ozkural <erayo@cs.bilkent.edu.tr> wrote:
> I've read a summary of a discussion about C++ module writing on
> this list, and I'd like to make some comments on it. [I'm not
> subscribed to this list, please retain a Cc: to my address]

I've had the (dubious) opportunity to write a C++
kernel module for Linux 2.2.x earlier this year for a client.
(Code is at:
http://www.smartdisk.com/Downloads/Software/flashpath-0.2.1.tar.gz )

Anyway, here's my two cents:

* If you have to port a C++ codebase to run in linux,
rewrite it in C.
* If you can't rewrite it in C (politics, size, time, etc)
make a C++<->C API translation.
* All kernel calls must go through the translation
* Use the minimal C++ runtime in flashpath-0.2.1/linux/cppfake.c

C++ is ugly as kernel code. I do _NOT_ recommend starting
a new project with it. However, if you're porting alien C++
code, it can be done. And it's not pretty.

ObWackyKernelLanguage: Objective C

If people are interested, I can whip up an Objective C
runtime for the kernel. Will be slow as molasses compared to
C, but should make for interesting driver modularity (and flame wars)...


--
Jason McMullan, Senior Linux Consultant, Linuxcare, Inc.
412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax
jmcmullan@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.332 / U:28.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site