yes thats right because PAGE_OFFSET is constant for each address translation for address range 3GB - (3GB + 896MB).
But this will come out to be negative number.
What do you mean by direct access of kernel space ? For every memory access VA -> PA translation is supposed to occur.
Yes. Correct! By direct access I meant the resulted PA will be equal to VA.
On 1/11/08, Mahaveer Darade <mah.darade@xxxxxxxxx> wrote:
On Jan 11, 2008 12:03 PM, sahlot arvind <asahlot@xxxxxxxxx> wrote:
Every virtual address above PAGE_OFFSET is the kernel, any address below PAGE_OFFSET is a user address.
Are you saying that Kernel sits in top 1 GB of 4 GB memory map and User processes run from lower 3 GB of 4 GB memory map?
As you said PA to VA is found by subtracting PAGE_OFFSET, that means it is not likePA = VA. Right?
yes thats right because PAGE_OFFSET is constant for each address translation for address range 3GB - (3GB + 896MB).
My doubt is that when PA = VA then why do we need to subtract PAGE_OFFSET and add PHYS_OFFSET?
As I said PA != VA. For each VA to PA conversion for upper 896MB virtual address range ( which is part of kernel virtual address space) we need to subtract PAGE_OFFSET.
CPU should be able to directly access addresses of kernel space if kernel is in ZONE_NORMAL and it is directly mapped.
What do you mean by direct access of kernel space ? For every memory access VA -> PA translation is supposed to occur.
- A.On 1/11/08, Mahaveer Darade <mah.darade@xxxxxxxxx > wrote:
On Jan 11, 2008 11:45 AM, sahlot arvind <asahlot@xxxxxxxxx> wrote:
Thanks for your response!
What is PAGE_OFFSET at 3GB on x86,?Kernel memory is defined to start at PAGE_OFFSET. (This is where the 3gig/1gig split is defined.) Every virtual address above PAGE_OFFSET is the kernel, any address below PAGE_OFFSET is a user address.
As you said PA to VA is found by subtracting PAGE_OFFSET, that means it is not likePA = VA. Right?
yes thats right.
On 1/11/08, Mahaveer Darade <mah.darade@xxxxxxxxx > wrote:
On Jan 11, 2008 10:57 AM, sahlot arvind <asahlot@xxxxxxxxx> wrote:
Hi All,I just started learning Linux Virtual Memory Management Subsystem.I see the memory is divided into three zones. Comments in file mm/mmzone.h/** ZONE_DMA < 16 MB ISA DMA capable memory
* ZONE_NORMAL 16-896 MB direct mapped by the kernel
* ZONE_HIGHMEM > 896 MB only page cache and user processes
*/
Here second comment (ZONE_NORMAL) says that it is directly mapped by kernel.Could anybody please tell me what does direct mean here?Does this mean Physical address = Virtual Address???
yes, thats right.
This means any virtual address can be translated to the physical address by simply subtracting PAGE_OFFSET at 3GB on x86, which is essentially what the function virt_to_phys() with the macro __pa() does.
Thanks- Arvind
--
---------------------------
Thanks & Regards,
Mahaveer Darade
mah.darade@xxxxxxxxx
Mobile - 9970365267
--- Dream it , Code it.
---The "silly question" is the first intimation of some totally new development
--
---------------------------
Thanks & Regards,
Mahaveer Darade
mah.darade@xxxxxxxxx
Mobile - 9970365267
--- Dream it , Code it.
---The "silly question" is the first intimation of some totally new development
--
---------------------------
Thanks & Regards,
Mahaveer Darade
mah.darade@xxxxxxxxx
Mobile - 9970365267
--- Dream it , Code it.
---The "silly question" is the first intimation of some totally new development