rem: vm_create_anonymous_region(vm_get_kernel_aspace_id(), "kernel_heap", &address, B_EXACT_KERNEL_ADDRESS,
add: vm_create_anonymous_region(vm_get_kernel_aspace_id(), "kernel_heap", &address, B_EXACT_ADDRESS,
context: vm_init(kernel_args *ka){	int err = 0;	unsigned int i;	struct preloaded_image *image;	addr_t heap_base;	void *address;	TRACE(("vm_init: entry\n"));	err = vm_translation_map_module_init(ka);	err = arch_vm_init(ka);	// initialize some globals	kernel_aspace = NULL;	next_region_id = 0;	region_hash_sem = -1;	next_aspace_id = 0;	aspace_hash_sem = -1;	max_commit = 0; // will be increased in vm_page_init	max_commit_lock = 0;	// map in the new heap and initialize it	heap_base = vm_alloc_from_ka_struct(ka, HEAP_SIZE, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);	TRACE(("heap at 0x%lx\n", heap_base));	heap_init(heap_base);	// initialize the free page list and physical page mapper	vm_page_init(ka);	// initialize the hash table that stores the pages mapped to caches	vm_cache_init(ka);	// create the region and address space hash tables	{		vm_address_space *aspace;		aspace_table = hash_init(ASPACE_HASH_TABLE_SIZE, (addr_t)&aspace->hash_next - (addr_t)aspace,			&aspace_compare, &aspace_hash);		if (aspace_table == NULL)			panic("vm_init: error creating aspace hash table\n");	}	{		vm_region *region;		region_table = hash_init(REGION_HASH_TABLE_SIZE, (addr_t)&region->hash_next - (addr_t)region,			&region_compare, &region_hash);		if (region_table == NULL)			panic("vm_init: error creating aspace hash table\n");	}	// create the initial kernel address space	{		aspace_id aid;		aid = vm_create_aspace("kernel_land", KERNEL_BASE, KERNEL_SIZE, true);		if (aid < 0)			panic("vm_init: error creating kernel address space!\n");		kernel_aspace = vm_get_aspace_by_id(aid);		vm_put_aspace(kernel_aspace);	}	// do any further initialization that the architecture dependant layers may need now	vm_translation_map_module_init2(ka);	arch_vm_init2(ka);	vm_page_init2(ka);	// allocate regions to represent stuff that already exists	address = (void *)ROUNDOWN(heap_base, PAGE_SIZE);	vm_create_anonymous_region(vm_get_kernel_aspace_id(), "kernel_heap", &address, B_EXACT_KERNEL_ADDRESS,		HEAP_SIZE, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);	ka->kernel_image.name = "kernel";		// the lazy boot loader currently doesn't set the kernel's name...	create_preloaded_image_areas(&ka->kernel_image);	// allocate areas for preloaded images	for (image = ka->preloaded_images; image != NULL; image = image->next) {		create_preloaded_image_areas(image);	}	// allocate kernel stacks	for (i = 0; i < ka->num_cpus; i++) {		char temp[64];		sprintf(temp, "idle_thread%d_kstack", i);		address = (void *)ka->cpu_kstack[i].start;		vm_create_anonymous_region(vm_get_kernel_aspace_id(), temp, &address, B_EXACT_KERNEL_ADDRESS,			ka->cpu_kstack[i].size, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);	}	{		void *null;		vm_map_physical_memory(vm_get_kernel_aspace_id(), "bootdir", &null, B_ANY_KERNEL_ADDRESS,			ka->bootdir_addr.size, B_KERNEL_READ_AREA, ka->bootdir_addr.start);	}	arch_vm_init_endvm(ka);	// add some debugger commands	add_debugger_command("regions", &dump_region_list, "Dump a list of all regions");	add_debugger_command("region", &dump_region, "Dump info about a particular region");	add_debugger_command("aspaces", &dump_aspace_list, "Dump a list of all address spaces");	add_debugger_command("aspace", &dump_aspace, "Dump info about a particular address space");	add_debugger_command("cache_ref", &dump_cache_ref, "Dump cache_ref data structure");	add_debugger_command("cache", &dump_cache, "Dump cache_ref data structure");//	add_debugger_command("dl", &display_mem, "dump memory long words (64-bit)");	add_debugger_command("dw", &display_mem, "dump memory words (32-bit)");	add_debugger_command("ds", &display_mem, "dump memory shorts (16-bit)");	add_debugger_command("db", &display_mem, "dump memory bytes (8-bit)");	TRACE(("vm_init: exit\n"));	return err;}