<p><br>
On Oct 17, 2012 2:22 PM, "Kshemendra KP" <<a href="mailto:kshemendra@suphalaam.com">kshemendra@suphalaam.com</a>> wrote:<br>
><br>
><br>
><br>
><br>
> On Wed, Oct 17, 2012 at 2:04 PM, Chetan Nanda <<a href="mailto:chetannanda@gmail.com">chetannanda@gmail.com</a>> wrote:<br>
>><br>
>><br>
>><br>
>> On Tue, Oct 16, 2012 at 5:47 PM, Kshemendra KP <<a href="mailto:kshemendra@suphalaam.com">kshemendra@suphalaam.com</a>> wrote:<br>
>>><br>
>>><br>
>>> On x86 kernel is normally split into 3GB (user) : 1 GB (Kernel) spaces. Kernel can only directly <br>
>>> manipulate 1 GB (around 889 MB) from the PAGE_OFFSET (0xC0000000). The user space <br>
>>> memofy below PAGE_OFFSET kernel can't directly access, it considers this memory as <br>
>>> high memory. Kernel needs to kmap()/kmap_atomic() map user page and access that region.<br>
>><br>
>> <br>
>> 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. <br>
>> High memory is a virtual address space with 1GB kernel space to map RAM pages beyond 896MB. <br>
><br>
><br>
> One thing not clear to me is, during boot, kernel is copied to 1st MB of the RAM in x86 architecture as this architecture<br>
> has ISA mem map hole (640k -to 1MB). From 1st BM till 896MB is occupied by the kernel. Then user space will be<br>
> made available beyond 896 MB. With this reasoning, it is not clear to me, whether user space which is present <br>
> beyond 896 MB is in high memory. </p>
<p>On x86 kernel will be loaded in RAM from 1st MB. But kernel code and data will not go upto 896MB. <br>
Kernel code + data will be loaded in ram from 1MB - end_data (IIRC). and address space between end_data to 896Mb is used for dynamic allocation (kmalloc ) etc...</p>
<p>I would recomend you to read 2nd chapter of understanding linux kernel. This chapter contain detailed info on memory addressing used by kernel on x86<br>
>><br>
>><br>
>> <br>
>>><br>
>>> If the memory is above 4 GB with page extension, it is clear that kernel can't access it as <br>
>>> kernel uses "void *" and/or "unsigned long" to hold the address. But it is not clear for me<br>
>>> why kernel's can't directly access memory below PAGE_OFFSET ( 0-3GB) directly.<br>
>><br>
>><br>
>> Kernel can access 0-3GB memory, take an example of application sending data to kernel via system call e.g. write.<br>
>> 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 .. <br>
>> <br>
>>><br>
>>><br>
>>> Regards<br>
>>><br>
>>> Kshemendra<br>
>>><br>
>>> _______________________________________________<br>
>>> Kernelnewbies mailing list<br>
>>> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
>>> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
>>><br>
Chetan Nanda</p>