<div dir="ltr"><div><div>You may want to look at this free course on kernel programming:<br><a href="http://crashcourse.ca/introduction-linux-kernel-programming/introduction-linux-kernel-programming" target="_blank">http://crashcourse.ca/<wbr>introduction-linux-kernel-<wbr>programming/introduction-<wbr>linux-kernel-programming</a><br></div>I believe that the entire course is free now (even though it mentions costing $39).<br><br></div>It has a section on creating proc filesystem entries.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 24, 2016 at 4:39 AM, Louie Lu <span dir="ltr">&lt;<a href="mailto:louie.lu@hopebaytech.com" target="_blank">louie.lu@hopebaytech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2016-08-24 18:23 GMT+08:00 Nikolay Borisov &lt;<a href="mailto:n.borisov.lkml@gmail.com">n.borisov.lkml@gmail.com</a>&gt;:<br>
&gt;<br>
&gt;<br>
&gt; On 08/24/2016 01:18 PM, Louie Lu wrote:<br>
&gt;&gt; Hi everyone,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m now reading *Unreliable Guide To Locking* which came from<br>
&gt;&gt; <a href="http://kernelnewbies.org" rel="noreferrer" target="_blank">kernelnewbies.org</a> (<a href="https://kernelnewbies.org/Documents/Kernel-Docbooks" rel="noreferrer" target="_blank">https://kernelnewbies.org/<wbr>Documents/Kernel-Docbooks</a>)<br>
&gt;&gt;<br>
&gt;&gt; What I want to do is trying run the code that in this doc from 7.1 All<br>
&gt;&gt; In User Context.<br>
&gt;&gt;<br>
&gt;&gt; In my knowing for kernel programming,<br>
&gt;&gt; I&#39;ll need to compile the code to something like<br>
&gt;&gt; `main.ko` then insert into kernel space using `insmod`.<br>
&gt;&gt;<br>
&gt;&gt; Here is the GitHub that I&#39;m doing PoC code:<br>
&gt;&gt; <a href="https://github.com/grapherd/unreliable_guide_to_locking" rel="noreferrer" target="_blank">https://github.com/grapherd/<wbr>unreliable_guide_to_locking</a><br>
&gt;&gt;<br>
&gt;&gt; My question is,<br>
&gt;&gt; Is my knowing right?<br>
&gt;&gt; and, how can I use the function in main.ko (e.g. cache_add).<br>
&gt;&gt; I&#39;m using these function by test.ko, is that a normal way to use it?<br>
&gt;&gt;<br>
&gt;&gt; in this doc have mention, there have hardirq, softirq.<br>
&gt;&gt; How can I test it from these irq method?<br>
&gt;&gt;<br>
&gt;<br>
&gt; You have to create some sort of an interface which utilizes those kernel<br>
&gt; function. That might be IOCTL or procfiles or debugfs or any other<br>
&gt; number of UM&lt;=&gt;KM interfaces.<br>
&gt;<br>
<br>
</span>Thanks for reply, I&#39;m now looking for procfs example,<br>
<br>
like this: <a href="http://www.tldp.org/LDP/lkmpg/2.6/html/x710.html" rel="noreferrer" target="_blank">http://www.tldp.org/LDP/lkmpg/<wbr>2.6/html/x710.html</a><br>
or this: <a href="https://kernelnewbies.org/Documents/Kernel-Docbooks?action=AttachFile&amp;do=get&amp;target=procfs-guide_2.6.29.pdf" rel="noreferrer" target="_blank">https://kernelnewbies.org/<wbr>Documents/Kernel-Docbooks?<wbr>action=AttachFile&amp;do=get&amp;<wbr>target=procfs-guide_2.6.29.pdf</a><br>
<br>
But it seems that all this tutorial were deprecate,<br>
since 3.10 change for proc_create_entry()<br>
<br>
Are there any resource for procfs to leran?<br>
<br>
thanks!.<br>
<span class="HOEnZb"><font color="#888888"><br>
Louie Lu.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks!<br>
&gt;&gt; Louie Lu.<br>
&gt;&gt;<br>
&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; Kernelnewbies mailing list<br>
&gt;&gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.<wbr>org</a><br>
&gt;&gt; <a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">https://lists.kernelnewbies.<wbr>org/mailman/listinfo/<wbr>kernelnewbies</a><br>
&gt;&gt;<br>
<br>
______________________________<wbr>_________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.<wbr>org</a><br>
<a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">https://lists.kernelnewbies.<wbr>org/mailman/listinfo/<wbr>kernelnewbies</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Dave Hylands<br>Shuswap, BC, Canada<br><a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a></div>
</div>