How to use /proc

Anuz Pratap Singh Tomar chambilkethakur at gmail.com
Sun Feb 5 17:37:59 EST 2012


Read LDD, there are plenty of examples on using proc interface.

On Sun, Feb 5, 2012 at 10:14 PM, Surenkumar Nihalani <suren at gatech.edu>wrote:

> 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 at gmail.com>
> To: "Surenkumar Nihalani" <suren at 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 at 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
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120205/457c07c2/attachment.html 


More information about the Kernelnewbies mailing list