From: suren@gatech.edu (Surenkumar Nihalani)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to use /proc
Date: Sun, 05 Feb 2012 17:14:02 -0500 (EST) [thread overview]
Message-ID: <f3f202d1-675e-46fb-b935-cb35eb3a4d0d@mail5.gatech.edu> (raw)
In-Reply-To: <CAEnQRZC9PZFLbVwUqo0Z02JFO-9EZFqfL7bERiFcPQoG0OT60Q@mail.gmail.com>
Hey Daniel,
Thanks for the quick reply.
The IBM tutorial helps me writing the function for handling user reads and writes to your corresponding proc file. It doesn't help in terms of opening
and writing from the kernel side.
the example you provided just creates a proc entry. It doesn't tell me how to write to it.
Please help.
Thanks,
Suren Nihalani.
----- Original Message -----
From: "Daniel Baluta" <daniel.baluta@gmail.com>
To: "Surenkumar Nihalani" <suren@gatech.edu>
Cc: Kernelnewbies at kernelnewbies.org
Sent: Sunday, February 5, 2012 4:20:28 PM
Subject: Re: How to use /proc
On Sun, Feb 5, 2012 at 11:07 PM, Surenkumar Nihalani <suren@gatech.edu> wrote:
> Hello Guys,
>
> I am CS student trying to write a kernel module as a part of my class
> assignment. I wanted to know, from within kernel, how do I read and write
> data to my proc file?
> I need to store state from last call of my function.
Hello,
Have you tried searching on the internet? :D [1].
Another approach is to see how an existing proc
entry is handled. Look for example at /proc/sched_debug [2].
thanks,
Daniel.
[1] http://www.ibm.com/developerworks/linux/library/l-proc/index.html
[2] http://lxr.linux.no/linux+v3.2.4/kernel/sched_debug.c#L393
next prev parent reply other threads:[~2012-02-05 22:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4F2EEC4D.8040403@gmail.com>
[not found] ` <4F2EED9F.3020803@gmail.com>
2012-02-05 21:00 ` How to create patch for checkpatch.pl cleanups kashyap gada
2012-02-05 21:07 ` How to use /proc Surenkumar Nihalani
2012-02-05 21:20 ` Daniel Baluta
2012-02-05 22:14 ` Surenkumar Nihalani [this message]
2012-02-05 22:37 ` Anuz Pratap Singh Tomar
2012-02-05 22:52 ` Greg KH
2012-02-05 21:10 ` How to create patch for checkpatch.pl cleanups Daniel Baluta
2012-02-05 22:51 ` Greg KH
2012-02-05 23:26 ` kashyap gada
2012-02-06 1:22 ` Greg KH
2012-02-06 11:56 ` Bernd Petrovitsch
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=f3f202d1-675e-46fb-b935-cb35eb3a4d0d@mail5.gatech.edu \
--to=suren@gatech.edu \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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;
as well as URLs for NNTP newsgroup(s).