<div>Hi Prasad,</div>
<div> </div>
<div>question is:  anyother way to access like iopl(3) function?.</div>
<div> </div>
<div>FYI, With iopl it is possible. But in my kernel i could not locate iopl function. Is there any similar function like iopl so that i will set  the permission as root id.<br><br></div>
<div class="gmail_quote">On Sun, Apr 3, 2011 at 3:47 PM, Prasad Joshi <span dir="ltr">&lt;<a href="mailto:prasadjoshi124@gmail.com">prasadjoshi124@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Sun, Apr 3, 2011 at 6:11 PM, Sengottuvelan S<br>&lt;<a href="mailto:sengottuvelan.s@gmail.com">sengottuvelan.s@gmail.com</a>&gt; wrote:<br>&gt; Hi All,<br>&gt;<br>&gt; I am trying to access /dev/mem in my user process. I could not access<br>
&gt; because not a privileged access. I tried to use iopl(3) call in linux 2.6,<br><br></div>I am not sure, but after reading the manpage, it looks like iopl will<br>give access to the IO ports not the files.<br>
<div class="im"><br>&gt; but i am getting unresolved symbol for this.  Is any other way to get access<br>&gt; in user process. I am not sure how to solve this. Can you someone throw some<br>&gt; light on this.<br>&gt;<br>
&gt;    if(iopl(3)){<br>&gt;         fprintf(stderr, &quot;Cannot get I/O permissions (being root helps)&quot;);<br>&gt;         return -1;<br>&gt;     }<br>&gt;   if ((fd = open(&quot;/dev/mem&quot;, O_RDWR | O_SYNC)) &lt; 0) {<br>
&gt;         fprintf(stderr, &quot;Failed to open /dev/mem&quot;);<br>&gt;         return -1;<br>&gt;     }<br><br></div>If you look at the file permission, you will notice only root has<br>permission to write the /dev/mem<br>
<br>$ ls -l /dev/mem<br>crw-r----- 1 root kmem 1, 1 2011-04-03 08:42 /dev/mem<br><br>Opening it for read/write will surely fail.<br><br>Thanks and Regards,<br>Prasad<br><br>&gt;<br>&gt; --<br>
<div class="im">&gt; Regards,<br>&gt; S. Sengottuvelan.<br>&gt;<br>&gt; --<br>&gt; Regards,<br>&gt; S. Sengottuvelan.<br>&gt;<br></div>&gt; _______________________________________________<br>&gt; Kernelnewbies mailing list<br>
&gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>&gt; <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
&gt;<br>&gt;<br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>S. Sengottuvelan.<br>