Chapter3:MemoryManagement
which callssetup_bootmem_allocatorto initialize the bootmem allocator, whereas AMD64 uses
contig_initmem_init.The code flow diagram in Figure 3-20 illustrates the individual steps involved in the initialization of the
bootmem allocator on IA-32 systems, and the corresponding diagram for AMD64 is shown in Figure 3-21.Determine usable low memory page framesCall reserve_bootmem to reserve special regionssetup_memoryreserve_bootmem(bootmap,bootmap_size)register_bootmem_low_pagesinit_bootmemsetup_bootmem_allocatorFigure 3-20: Initialization of the bootmem allocator on IA-32 machines.Find suitable memory areacontig_initmembootmem_bootmap_pagesinit_bootmemregister_bootmem_with_active_regionsreserve_bootmem (bootmap,bootmap_size)Figure 3-21: Initialization of the bootmem allocator on
AMD64 machines.Initialization for IA-32
setup_memoryanalyzes the detected memory regions to find the maximal page frame number in the low
memory region; high memory is of no use for the bootmem allocator because it is too complicated to
handle. The global variablemax_low_pfnholds the number of the highest mappable page. The kernel
reports the amount of memory found in its boot logs.wolfgang@meitner>dmesg
...
0MB HIGHMEM available.
511MB LOWMEM available.
...