lkml.org 
[lkml]   [2002]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Communication between two kernel modules
Date
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ž.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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