- syscall_install();
-
- for (size_t i = 256; i < hhk_init_pg_count; i++) {
- vmm_del_mapping(PD_REFERENCED, (void*)(i << PG_SIZE_BITS));
- }
-}
-
-void
-lock_reserved_memory()
-{
- multiboot_memory_map_t* mmaps = _k_init_mb_info->mmap_addr;
- size_t map_size =
- _k_init_mb_info->mmap_length / sizeof(multiboot_memory_map_t);
- // v_mapping mapping;
- for (unsigned int i = 0; i < map_size; i++) {
- multiboot_memory_map_t mmap = mmaps[i];
- if (mmap.type == MULTIBOOT_MEMORY_AVAILABLE) {
- continue;
- }
- uint8_t* pa = PG_ALIGN(mmap.addr_low);
- size_t pg_num = CEIL(mmap.len_low, PG_SIZE_BITS);
- for (size_t j = 0; j < pg_num; j++) {
- uintptr_t _pa = pa + (j << PG_SIZE_BITS);
- // if (vmm_lookup(_pa, &mapping) && *mapping.pte) {
- // continue;
- // }
- vmm_set_mapping(PD_REFERENCED, _pa, _pa, PG_PREM_R, VMAP_IGNORE);
- pmm_mark_page_occupied(KERNEL_PID, _pa >> 12, 0);
- }
- }