文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>paging_init()

paging_init()

时间:2010-10-15  来源:letmego163

[start_kernel --> setup_arch --> paging_init]

paging_init is invoked on IA-32 systems during the boot process to split the virtual address space.


pagetable_init first initializes the page tables of the system using swapper_pg_dir as a basic.


The TLB entries must also be flushed because they still contain boot memory allocation data.
__flush_all_tlb does the necessary work.

kmap_init initializes the global variable kmap_pte. The kernel uses this variable to store the page table
entry for the area later used to map pages from the highmem zone into kernel address space. Besides,
the address of the first fixmap area for highmem kernel mappings is stored in the global variable
kmem_vstart.


/*
 * paging_init() sets up the page tables - note that the first 8MB are
 * already mapped by head.S.
 *
 * This routines also unmaps the page at virtual kernel address 0, so
 * that we can trap those pesky NULL-reference errors in the kernel.
 */
void __init paging_init(void)
{
    pagetable_init();

    __flush_tlb_all();

    kmap_init();

    /*
     * NOTE: at this point the bootmem allocator is fully available.
     */
    sparse_init();
    zone_sizes_init();
}




static void __init pagetable_init(void)
{
    pgd_t *pgd_base = swapper_pg_dir;

    permanent_kmaps_init(pgd_base);
}




static void __init kmap_init(void)
{
    unsigned long kmap_vstart;

    /*
     * Cache the first kmap pte:
     */
    kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
    kmap_pte = kmap_get_fixmap_pte(kmap_vstart);

    kmap_prot = PAGE_KERNEL;
}


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载