<div><br></div><div><br><div><br><div class="gmail_quote">On Wed, Oct 17, 2012 at 2:04 PM, Chetan Nanda <span dir="ltr"><<a href="mailto:chetannanda@gmail.com" target="_blank">chetannanda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div class="im">On Tue, Oct 16, 2012 at 5:47 PM, Kshemendra KP <span dir="ltr"><<a href="mailto:kshemendra@suphalaam.com" target="_blank">kshemendra@suphalaam.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><div> On x86 kernel is normally split into 3GB (user) : 1 GB (Kernel) spaces. Kernel can only directly </div><div> manipulate 1 GB (around 889 MB) from the PAGE_OFFSET (0xC0000000). The user space </div><div> memofy below PAGE_OFFSET kernel can't directly access, it considers this memory as </div>
<div> high memory. Kernel needs to kmap()/kmap_atomic() map user page and access that region.</div></blockquote><div> </div></div><div>As per my understanding, if kernel code is running under a process context then it can access lower 3GB address space, provided address in 0-3GB is in process address space. And its not a high memory. </div>
<div>High memory is a virtual address space with 1GB kernel space to map RAM pages beyond 896MB. </div></div></blockquote><div><br></div><div>One thing not clear to me is, during boot, kernel is copied to 1st MB of the RAM in x86 architecture as this architecture</div>
<div>has ISA mem map hole (640k -to 1MB). From 1st BM till 896MB is occupied by the kernel. Then user space will be</div><div>made available beyond 896 MB. With this reasoning, it is not clear to me, whether user space which is present </div>
<div>beyond 896 MB is in high memory. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div class="im"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div></div><div> If the memory is above 4 GB with page extension, it is clear that kernel can't access it as </div>
<div> kernel uses "void *" and/or "unsigned long" to hold the address. But it is not clear for me</div><div> why kernel's can't directly access memory below PAGE_OFFSET ( 0-3GB) directly.</div>
</blockquote><div><br></div></div><div>Kernel can access 0-3GB memory, take an example of application sending data to kernel via system call e.g. write.</div><div>in Write system call pointer to the buffer will be in 0-3Gb address space of calling application. And kernel will access this address to write data to drivers/etc .. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>Regards</div><span><font color="#888888"><div><br></div><div>Kshemendra</div>
</font></span><br>_______________________________________________<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><span class="HOEnZb"><font color="#888888">Chetan Nanda
</font></span></blockquote></div><br></div></div>