- struct boot_mmapent *mmap = bhctx->mem.mmap, *mmapent;
- for (size_t i = 0; i < bhctx->mem.mmap_len; i++) {
- mmapent = &mmap[i];
- size_t size_pg = leaf_count(mmapent->size);
- pfn_t start_pfn = pfn(mmapent->start);
+ // 将内核占据的页,包括前1MB,hhk_init 设为已占用
+ size_t pg_count = leaf_count(to_kphysical(__kexec_end));
+ pmm_onhold_range(0, pg_count);
+
+ size_t i;
+ struct boot_mmapent* ent;
+ for (i = 0; i < bhctx->mem.mmap_len; i++) {
+ ent = &bhctx->mem.mmap[i];