All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuliano Pochini <pochini@denise.shiny.it>
To: Bart Samwel <bart@samwel.tk>
Cc: root@chaos.analogic.com, Ashish sddf <buff_boulder@yahoo.com>,
	Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: Compiling C++ kernel module + Makefile
Date: Wed, 21 Jan 2004 18:01:01 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.58.0401211748130.1567@denise.shiny.it> (raw)
In-Reply-To: <400C4B17.3000003@samwel.tk>



On Mon, 19 Jan 2004, Bart Samwel wrote:

> But we're not talking about the base kernel here. We're not talking
> about migrating the kernel to C++, or even modules that are part of the
> Linux kernel source. We're talking about *independent modules*. The
> kernel exports a module interface, and any binary driver that correctly
> hooks into the interface of the running kernel (using the correct
> calling conventions of the running kernel) and behaves properly (e.g.,
> doesn't do stack unwinds over chunks of kernel functions etc.) can hook
> into it and do useful work. If somebody has decided that it would be
> worth it for his project to use C++ (without exceptions, rtti and the
> whole shebang) then so be it, why should you care? It's just binary code
> that hooks into the module interface, using the correct calling
> conventions. It doesn't do dirty stuff -- no exceptions, no RTTI,
> etcetera. It compiles into plain, module-interface conforming assembler,
> that can be compiled with -- you guessed it -- 'as', the AT&T syntax
> assembler. Yes, they're taking a risk. Their risk is that C++ can't
> import the kernel headers, or that C++ might someday need runtime
> support that cannot be ported into the kernel.

I managed to use a a lot of C++ code in a kernel modules. I used wrapper
functions to pass data between C and C++ parts. C++ code had no exceptions
and such thing, but I had to play some dirty tricks anyway because C++
code needs stuff which is provided by userpace libraries to run.
Maybe the right solution is writing a module that provides a fast data
path between the kernel and the userspace router.


--
Giuliano.

  parent reply	other threads:[~2004-01-21 17:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-16 21:09 Compiling C++ kernel module + Makefile Ashish sddf
2004-01-16 22:07 ` Richard B. Johnson
2004-01-17 12:59   ` Bart Samwel
2004-01-19 13:46     ` Richard B. Johnson
2004-01-19 17:40       ` Bart Samwel
2004-01-19 18:39         ` Richard B. Johnson
2004-01-19 20:02           ` Bart Samwel
2004-01-19 20:37             ` Richard B. Johnson
2004-01-19 21:24               ` Bart Samwel
2004-01-20 15:20                 ` Richard B. Johnson
2004-01-20 17:34                   ` Zan Lynx
2004-01-20 18:10                     ` Richard B. Johnson
2004-01-20 13:38                       ` Thomas Lahoda
2004-01-21  2:24                       ` Michael Clark
2004-01-20 18:16                     ` Chris Friesen
2004-01-21 17:01                 ` Giuliano Pochini [this message]
2004-01-21 17:16                   ` Bart Samwel
2004-01-20  0:59               ` Robin Rosenberg
2004-01-20  6:46                 ` Linus Torvalds
2004-01-20  7:32                   ` Robin Rosenberg
2004-01-20 10:46                   ` Bart Samwel
2004-01-20  5:29         ` Valdis.Kletnieks
2004-01-20  9:48           ` Bart Samwel
2004-01-16 22:40 ` Sam Ravnborg
2004-01-19 13:21 Petr Vandrovec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0401211748130.1567@denise.shiny.it \
    --to=pochini@denise.shiny.it \
    --cc=bart@samwel.tk \
    --cc=buff_boulder@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.