<div class="gmail_quote">On Thu, Oct 6, 2011 at 9:42 PM, rohan puri <span dir="ltr">&lt;<a href="mailto:rohan.puri15@gmail.com">rohan.puri15@gmail.com</a>&gt;</span> wrote:<br><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Oct 7, 2011 at 4:13 AM, Vaibhav Jain <span dir="ltr">&lt;<a href="mailto:vjoss197@gmail.com" target="_blank">vjoss197@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote"><div><div></div><div class="h5">
<div><br><br><div class="gmail_quote">On Thu, Oct 6, 2011 at 11:28 AM, Mulyadi Santosa <span dir="ltr">&lt;<a href="mailto:mulyadi.santosa@gmail.com" target="_blank">mulyadi.santosa@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
Hi...<br>
<div><br>
On Thu, Oct 6, 2011 at 02:34, Vaibhav Jain &lt;<a href="mailto:vjoss197@gmail.com" target="_blank">vjoss197@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am trying to run a program that scans memory from a given physical address<br>
&gt; using /dev/mem.<br>
&gt; It uses mmap to map physical address from /dev/mem. So to start with I used<br>
&gt; /proc/iomem to look up the<br>
&gt; physical memory mapping and found the address 00010000 to be the starting<br>
&gt; address for System ram. But whenever I<br>
&gt; provide this address to the program it throws an error of &quot;Operation not<br>
&gt; permitted&quot;.<br>
<br>
</div>Probably this could also due to mmap NULL dereferencing protection (at<br>
least that&#39;s how I name it :) )<br>
<br>
By default, the lowest 65536 byte (10000 in hex) is protected from<br>
mapping etc. It practically render such null dererefencing useless.<br>
<font color="#888888"><br>
<br>
--<br>
regards,<br>
<br>
Mulyadi Santosa<br>
Freelance Linux trainer and consultant<br>
<br>
blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
</font></blockquote></div></div><div><br>Hi,</div><div> </div><div>I tried the same with other addresses (greater than 0x10000 ) also but it is throwing the same error.</div><div>Is there a way to get over this ?</div><div>

 </div>
<div>Thanks</div><div>Vaibhav Jain</div><font color="#888888"><div> </div><div> </div>
</font><br></div></div>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div>Hi Vaibhav,<br><br>This is how it can be done. Refer link <a href="http://www.theknotter.net/system-memory-dumps-on-linux/" target="_blank">http://www.theknotter.net/system-memory-dumps-on-linux/</a><br>
<br>I have attached the modified code which disables the socket creation part and dumps the output in a file.<br>
<br>Regards,<br><font color="#888888">Rohan Puri<br>
</font></blockquote></div><div><br> </div><div>Thanks Rohan for the code but I already have a code that reads memory using /dev/mem and mmap.</div><div>Only difference is I have to manually change the starting address in program. The problem is whenver I give </div>
<div>any System RAM address the mmap call fails with &#39;Operation not permitted&#39;. I googled a little and found that normally</div><div>this operation is not allowed and the kernel has to be compiled with CONFIG_STRICT_DEVMEM disabled to read any memory </div>
<div>location in this way. I also found out about the boot option &#39;strict-devmem =0&#39;. I tried both these options but none of them seems to working.</div><div>So I am trying to figure out if there is some other setting that I need to change.</div>
<div>I am doing this on Fedora 15 - 2.6.38 kernel.</div><div> </div><div>Thanks</div><div>Vaibhav Jain<br></div><div> </div>