-
- // First pass, to mark the physical pages
- for (unsigned int i = 0; i < map_size; i++) {
- multiboot_memory_map_t mmap = map[i];
- if (mmap.type == MULTIBOOT_MEMORY_AVAILABLE) {
- // 整数向上取整除法
- ptr_t pg = map[i].addr_low + 0x0fffU;
- pmm_mark_chunk_free(pg >> PG_SIZE_BITS,
- map[i].len_low >> PG_SIZE_BITS);
- }
- }
-