next up previous
Next: free_area_init() Up: Page table setup Previous: paging_init()


Setting up page table is just a task of allocating pages for the page directories and adding page table entries in these pages. The algorithm is presented here. The algorithm does not explain about page middle directories yet.

  1. Memory for the swapper_pg_dir is already allocated. Allocate physical pages (using the bootmem allocator).
  2. The number of pages required depends on the amount of physical pages present and the number of "page table entries" a page directory can accomodate (Specified by PTRS_PER_PTE define).
  3. For each physical page add an entry in the page directory.
  4. Now, put the page directory entries into the page global directory.
When such an arrangement is done, it is possible to transform the virtual address passsed to the processor, into physical one, by the paging circutary.

The actual happenings in pagetable_init() is presented as a flow chart here