public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rok Papež" <rok.papez@kiss.uni-lj.si>
To: Michael Zhu <mylinuxk@yahoo.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Communication between two kernel modules
Date: Mon, 18 Feb 2002 19:30:02 +0100	[thread overview]
Message-ID: <02021819300201.00953@strader.home> (raw)
In-Reply-To: <20020218173229.47247.qmail@web14907.mail.yahoo.com>
In-Reply-To: <20020218173229.47247.qmail@web14907.mail.yahoo.com>

Hello Michael!

On Monday 18 February 2002 18:32, Michael Zhu wrote:

> Hi, how can I call some kind of APIs from kernel mode,
> such as open, ioctl and close? Because I need to use
> some services of another kernel module from my kernel
> module and I have no source code of the module which
> provides the services. Now I can only access the
> module in user space using the open, ioctl and close
> APIs. Can I do the same thing in my kernel module?
> Thanks.

Create a user-space app that will ioctl into your driver and wait for 
requests. When your module needs to call the other module it delivers request 
to the user-space app wich in turn calls the other module and returns results 
via another ioctl call.

Take care not to deadlock.. In user space app use fork() or threads and 
handle module requests async...

Be ready to handle an event when your user-space app unexpectedly dies.

-- 
best regards,
Rok Papež.

  reply	other threads:[~2002-02-19  6:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-18 17:32 Communication between two kernel modules Michael Zhu
2002-02-18 18:30 ` Rok Papež [this message]
2002-02-20  9:28   ` Jan Hudec
2003-02-25  9:06     ` Problem kernel 2.2.23 Paco Martinez
  -- strict thread matches above, loose matches on Subject: below --
2002-02-18 17:32 Communication between two kernel modules Michael Zhu

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=02021819300201.00953@strader.home \
    --to=rok.papez@kiss.uni-lj.si \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mylinuxk@yahoo.ca \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox