WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] memory manager in Mini-os - are initial page tables still pl

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] memory manager in Mini-os - are initial page tables still placed at the top of memory ???
From: Richard <judicator3@xxxxxxxxx>
Date: Thu, 24 Feb 2005 19:09:35 -0500
Delivery-date: Fri, 25 Feb 2005 00:11:44 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=Q0RHnMEPU1O2S3u86TWlL6mQQJQCxTAIoq+XblQfnb8u0nMcown4sYNKoOxRFIdrE1Dny9C8f9x03DpUNyDtFdbvnmhAvoEB3vWZVQEO3TOsxhhOfTJN0Zx2KYEfYnnjI6W455eXz/zXrtn98gXJCh8J/vh1jrPJHgwGJF9qJv0=
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Reply-to: Richard <judicator3@xxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Hello,

I am still working on mini-os :).
I think that the memory manager (file mm.c) for mini-os is pretty
outdated. I just want to confirm something. In the function init_mm()
in file mm.c, it is assumed that XEN places the initial page tables at
the TOP of the available memory. Mini-os uses that information to
calculate the number of free page frames available to use. Is that
still the case nowadays ?

Below is part of the function init_mm() and the comments inside init_mm()
=========================================================================
   unsigned long *pgd = (unsigned long *)start_info.pt_base;

    /* set up minimal memory infos */
    start_pfn = PFN_UP(to_phys(&_end));
    max_pfn = start_info.nr_pages;

    printk("  start_pfn:    %lx\n", start_pfn);
    printk("  max_pfn:      %lx\n", max_pfn);

    /*
     * we know where free tables start (start_pfn) and how many we 
     * have (max_pfn). 
     * 
     * Currently the hypervisor stores page tables it providesin the
     * high region of the this memory range.
     * 
     * next we work out how far down this goes (max_free_pfn)
     * 
     * XXX this assumes the hypervisor provided page tables to be in
     * the upper region of our initial memory. I don't know if this 
     * is always true.
     */

    max_free_pfn = PFN_DOWN(to_phys(pgd));
    {
        unsigned long *pgd = (unsigned long *)start_info.pt_base;
        unsigned long  pte;
        int i;
        printk("  pgd(pa(pgd)): %lx(%lx)", (u_long)pgd, to_phys(pgd));

        for ( i = 0; i < (HYPERVISOR_VIRT_START>>22); i++ )
        {
            unsigned long pgde = *pgd++;
            if ( !(pgde & 1) ) continue;
            pte = machine_to_phys(pgde & PAGE_MASK);
            printk("  PT(%x): %lx(%lx)", i, (u_long)to_virt(pte), pte);
            if (PFN_DOWN(pte) <= max_free_pfn) 
                max_free_pfn = PFN_DOWN(pte);
        }
    }
    max_free_pfn--;
    printk("  max_free_pfn: %lx\n", max_free_pfn);
=========================================================================

Thanks
Richard


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] memory manager in Mini-os - are initial page tables still placed at the top of memory ???, Richard <=