Re: Basic Fork Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/18/06, Niklaus <niklaus@xxxxxxxxx> wrote:
On 4/17/06, Gaurav Dhiman <gauravd.chd@xxxxxxxxx> wrote:
> On 4/17/06, Asim Kadav <linkasim@xxxxxxxxx> wrote:
> > Hi,
> >
> > Process A has a memory allocated and memory pointer x pointing to that memory.
> > I fork process B from a running process A.B gets a new copy of the
> > memory and the pointer.However , printing x in A and B points to the
> > same memory location(though actually differnt physical memory
> > locations).What is the concept of VM here.Can anyone kindly explain ?
>
> The address you are seeing here are the virtual address not the
> physical address. Virtual address are mapped to physical address
> through page table and page directory structures which are different
> for every process.  The virtual address you are seeing is 32 bit
> address, this is divided into three parts, first 10 bits tells the
> index into page directory whose base address is stored in CR3 register
> of processor in i386 architecture. From this index we get the base
> address of concerned page table. Next 10 bits of virtual address is
> the index into page table whose base address we just got from page
> directory. Now at this index in page table we get the base address of
> the physical page we are concerned with. Now last 12 bits of virtual
> address is an offset into this physical address. This is how the
> virtual address is converted to physical address.
>
If the virtual address are same , then how can the physical address be
different. Can you give some examples please. I am not clear about
that.

Hi All:
i think the answer of your question is written in Mr.Gaurav's reply
>Virtual address are mapped to physical address
> through page table and page directory structures which are different
> for every process
thanks

MHD.Tayseer




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux