Initialization for AMD64

While the technical details of bootmem initialization differ on AMD64, the general structure is rather similar to the IA-32 case. This time contig_initmem is the responsible dispatcher.

First of all, bootmem_bootmap_bitmap computes the number of pages required for the bootmem bitmap. Using the information provided by the BIOS in the e820 map, this allows — as on IA-32 — for finding a continuous memory region of suitable size that is populated with proper RAM pages.

This information is then filled into the architecture-independent bootmem data structure using init_bootmem. As before, the function marks all pages as reserved, and the free pages must now be selected. free_bootmem_with_active_regions can once more use the information in the e820 map to free all memory regions that were reported as usable by the BIOS. Finally, a single call to reserve_bootmem is sufficient to register the space required for the bootmem allocation bitmap. In contrast to IA-32, it is not required to reserve space for legacy information on magical places in memory.

Continue reading here: Even though the name allocbootmempages suggests that the required size is specified in page units pages refers only to the alignment of the data

Was this article helpful?

0 0