next up previous
Next: Bootmem Handling Up: MM Sub-System initialization. Previous: Paging start

Start Paging

File : arch/i386/kernel/setup.c

"setup.c" holds the code which completes the E820 memory map setup in setup.S and starts paging.

For easy understanding the logic used for page frame number (PFN) calculation is given here.

  1. Setup the memory region by calling setup_memory_region()
  2. Get the lowest and highest PFN.
  3. If the highest PFN is greater than 229376 (the margin at 896 MB. It is not at 1024 MB because, 128 MB address space is allocated for vmalloc and inird), than HIGH_MEMORY is present.
  4. If the highest PFN is grater than 1048576, then PAE memory is present. (PAE memory is a enhancement provided by some Intel processors to give 64GB address space, using 36-bit addresses)
  5. Get the start_pfn as the address of the _end symbol of the kernel. The address is rounded off to the nearest next page boundary (4kb).
  6. calculate max_pfn. This is done using the following logic.
  7. Call init_bootmem and save the size of the page bitmap. (init_bootmem is called only with the low memory i.e.start_pfn and max_low_pfn)
  8. Now init_bootmem would have reserved all the page frames. So go through all the page frames and free every region of memory termed as E820_RAM in the E820 memory map.
  9. Reserve the physical page 0 with the boot memory as it is a bios page (not on all but some bios). Also Reserve the whole bootmem bitmap.
  10. call paging_init (of arch/i386/mm/init.c).


next up previous
Next: Bootmem Handling Up: MM Sub-System initialization. Previous: Paging start
2002-09-22