* Communication between two kernel modules
@ 2002-02-18 17:32 Michael Zhu
2002-02-18 18:30 ` Rok Papež
0 siblings, 1 reply; 5+ messages in thread
From: Michael Zhu @ 2002-02-18 17:32 UTC (permalink / raw)
To: linux-kernel
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.
Michael
______________________________________________________________________
Web-hosting solutions for home and business! http://website.yahoo.ca
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Communication between two kernel modules
2002-02-18 17:32 Communication between two kernel modules Michael Zhu
@ 2002-02-18 18:30 ` Rok Papež
2002-02-20 9:28 ` Jan Hudec
0 siblings, 1 reply; 5+ messages in thread
From: Rok Papež @ 2002-02-18 18:30 UTC (permalink / raw)
To: Michael Zhu; +Cc: linux-kernel
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ž.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Communication between two kernel modules
2002-02-18 18:30 ` Rok Papež
@ 2002-02-20 9:28 ` Jan Hudec
2003-02-25 9:06 ` Problem kernel 2.2.23 Paco Martinez
0 siblings, 1 reply; 5+ messages in thread
From: Jan Hudec @ 2002-02-20 9:28 UTC (permalink / raw)
To: Rok Papež, mylinuxk, linux-kernel
> > 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?
> 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.
Seems way too complicated to me. You can do everything from kernel.
You probably shouldn't use file handles in kernel, but you can use
file structure. Just open via filp_open, ioctl via ->f_op->ioctl
and close via filp_close (it will fput the structure).
You have to be in process context, either your ioctl handler or kernel
thread would do.
--------------------------------------------------------------------------------
- Jan Hudec `Bulb' <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 5+ messages in thread* Problem kernel 2.2.23
2002-02-20 9:28 ` Jan Hudec
@ 2003-02-25 9:06 ` Paco Martinez
0 siblings, 0 replies; 5+ messages in thread
From: Paco Martinez @ 2003-02-25 9:06 UTC (permalink / raw)
To: linux-kernel
Estimated gurus.
I have updated my PC from 2.2.14 to 2.2.23 -owing to SYN Cookies Problemm-
Since I have updated to 2.2.23, -one month ago-, my PC has reset 4 times,
and there is no error in log files.
This kernel has any problem with memory ??
Is there any patch for this problem ??
Even, in apache files appears "mmap_handler: mmap failed"
Thank you !!!!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Communication between two kernel modules
@ 2002-02-18 17:32 Michael Zhu
0 siblings, 0 replies; 5+ messages in thread
From: Michael Zhu @ 2002-02-18 17:32 UTC (permalink / raw)
To: linux-kernel
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.
Michael
______________________________________________________________________
Web-hosting solutions for home and business! http://website.yahoo.ca
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-02-25 8:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-18 17:32 Communication between two kernel modules Michael Zhu
2002-02-18 18:30 ` Rok Papež
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox