Hello,
I have written one /proc file creation kernel
module. This module creates /proc/file and defied
operations on it. Also i have written user program
that will read & write to /proc files from user space.
Now what i want is to use same bufproc_read &
bufproc_write functions defined in /proc file
handling kernel module to be used in another kernel
module to read that /proc/file in kernel module.The
second kernel module only used to read /proc file in
kernel. I am not understanding how can i open that
/proc/file in second kenrel module to read in kernel?
regards,
linux_lover.
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
On Sun, 2005-02-06 at 22:17 -0800, linux lover wrote:
> Hello,
> I have written one /proc file creation kernel
> module. This module creates /proc/file and defied
> operations on it. Also i have written user program
> that will read & write to /proc files from user space.
> Now what i want is to use same bufproc_read &
> bufproc_write functions defined in /proc file
> handling kernel module to be used in another kernel
> module to read that /proc/file in kernel module.The
> second kernel module only used to read /proc file in
> kernel. I am not understanding how can i open that
> /proc/file in second kenrel module to read in kernel?
> regards,
the answer really is that you should not read files from kernel
modules; /proc or otherwise.
Hi,
> > I have written one /proc file creation kernel
> > module. This module creates /proc/file and defied
> > operations on it. Also i have written user program
> > that will read & write to /proc files from user space.
> > Now what i want is to use same bufproc_read &
> > bufproc_write functions defined in /proc file
> > handling kernel module to be used in another kernel
> > module to read that /proc/file in kernel module.The
> > second kernel module only used to read /proc file in
> > kernel. I am not understanding how can i open that
> > /proc/file in second kenrel module to read in kernel?
> > regards,
>
> the answer really is that you should not read files from kernel
> modules; /proc or otherwise.
the only thing that is may needed by a kernel driver should be an
external firmware file and for that we have request_firmware(). For
everything else you are on the wrong track.
Regards
Marcel
Am 2005-02-07 07:38:36, schrieb Arjan van de Ven:
> the answer really is that you should not read files from kernel
> modules; /proc or otherwise.
I think, he mean something like
echo "1" >/proc/sys/net/ipv4/ip_forward
Where you can (de)activate Kernel functions.
Greetings
Michelle
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSM LinuxMichi
0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
linux lover <[email protected]> writes:
> Now what i want is to use same bufproc_read &
> bufproc_write functions defined in /proc file
> handling kernel module to be used in another kernel
> module to read that /proc/file in kernel module.The
> second kernel module only used to read /proc file in
> kernel. I am not understanding how can i open that
> /proc/file in second kenrel module to read in kernel?
Look at kernel_read() in fs/exec.c and fs/binfmt_*.c
Regards, Olaf.
On Mon, 07 Feb 2005 07:38:36 +0100, Arjan van de Ven said:
> On Sun, 2005-02-06 at 22:17 -0800, linux lover wrote:
> > Now what i want is to use same bufproc_read &
> > bufproc_write functions defined in /proc file
> > handling kernel module to be used in another kernel
> > module to read that /proc/file in kernel module.The
> > second kernel module only used to read /proc file in
> > kernel. I am not understanding how can i open that
> > /proc/file in second kenrel module to read in kernel?
> > regards,
>
> the answer really is that you should not read files from kernel
> modules; /proc or otherwise.
As Arjan said - what you probably want to be doing instead is changing
the code in your first module that provides the bufproc_* functions so
that they're wrappers around some code that does the "real work", and
then call the real_work function from your second module. Most likely,
what you *really* want to be passing around is some 'struct *foo', and
the bufproc_* functions are converting to/from a struct foo and a linear
byte stream. (In the limiting case where it's just one variable, why not
just 'EXPORT_SYMBOL(variable)' in the first module and then just assign or
read the variable from the second module?)