<br><br><div class="gmail_quote">On Fri, Oct 7, 2011 at 12:41 PM, Vaibhav Jain <span dir="ltr">&lt;<a href="mailto:vjoss197@gmail.com">vjoss197@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><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" target="_blank">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>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>
<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></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>
</blockquote></div>Hi Vaibhav,<br><br>My iomem file : -<br><br>00000000-0000ffff : reserved<br><b>00010000-0009f3ff : System RAM</b><br>0009f400-0009ffff : reserved<br>000c0000-000c7fff : Video ROM<br>000cc000-000ccfff : Adapter ROM<br>
000cd000-000cffff : pnp 00:0c<br>000e0000-000effff : pnp 00:0c<br>000f0000-000fffff : reserved<br>  000f0000-000fffff : System ROM<br><b>00100000-cf6dffff : System RAM</b><br>  01000000-015dadf2 : Kernel code<br>  015dadf3-01ab907f : Kernel data<br>
  01bb1000-01d04fff : Kernel bss<br><br>Now the program which i sent you, with that I am able to read the 1st part of System RAM successfully. I am getting the operation not permitted error from mmap  for second part of System RAM. Can you verify the same on your system. I mean are you able to read the 1st part (if your System RAM is divided) or not ?<br>
<br>Regards,<br>Rohan Puri<br>