VM areas

Bikram Kumar Gupta (bgupta@cisco.com)
Thu, 29 Jun 2000 17:24:23 +0530


Hi,

I am new to linux-kernel. I Will be thankful for
clarifying it.

Virtual Memory areas in a process are represented in
vm_area_struct. Is it necessary that there should be
only that many vm_area_struct objects (for a process)
as the number of segments. In that case, it should be
2 (text, data/stack).

Given a executable code, how does Kernel divides it
into different VM areas?

NOW...there has to be conversion from logical address
(48 bit) to linear address and then linear address is
to be converted into physical address for every
instruction. mm_struct structure describes the memeory
layout of the whole process. It contains a pointer to
Page directory (pgd). Given an instruction (logical
address), how the kernel determines which VM area
it is in, and then how does it get the base of that
VM area.

In theory, every process has a LDT, which describes
the segments (segment ~ VM area???). So from the
higher-order 12 bit of the logical address, CPU gets
the segment selector, then from LDT/GDT, it gets the
segment descriptor (64 bits), which contains the
base address in linear address space. So, by adding
the offset (lower 32 bits) to the base, it gets the
linear address. Then through pgd, it can locate the
physical address. Am I clear on my theoretical concepts?
If so, then how it has been implemented in programming?

I saw the useful docs on memory management in LDP &
KHG, but I am still unclear. Can you please clarify?

-- 
Thanks,
Bikram

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/