rem: if (length == OF_FAILED)
add: if (length == OF_FAILED) { puts("no OF translations");
context: find_allocated_ranges(void *pageTable, void **_physicalPageTable){	// we have to preserve the OpenFirmware established mappings	// if we want to continue to use its service after we've	// taken over (we will probably need less translations once	// we have proper driver support for the target hardware).	int mmu;	if (of_getprop(gChosen, "mmu", &mmu, sizeof(int)) == OF_FAILED)		return B_ERROR;	mmu = of_instance_to_package(mmu);	struct translation_map {		void	*virtual_address;		int		length;		void	*physical_address;		int		mode;	} translations[64];	int length = of_getprop(mmu, "translations", &translations, sizeof(translations));	if (length == OF_FAILED)		return B_ERROR;	length = length / sizeof(struct translation_map);	uint32 total = 0;	printf("found %d translations\n", length);	for (int i = 0; i < length; i++) {		struct translation_map *map = &translations[i];		//printf("%i: map: %p, length %d -> physical: %p, mode %d\n", i, map->virtual_address, map->length, map->physical_address, map->mode);		// insert range in physical allocated, if it points to physical memory		if (is_physical_memory(map->physical_address)			&& insert_physical_allocated_range(map->physical_address,					map->length) < B_OK) {			printf("cannot map physical allocated range (num ranges = %lu)!\n", gKernelArgs.num_physical_allocated_ranges);			return B_ERROR;		}		if (map->virtual_address == pageTable) {			puts("found page table!");			*_physicalPageTable = map->physical_address;		}		// insert range in virtual allocated		if (insert_virtual_allocated_range(map->virtual_address,				map->length) < B_OK) {			printf("cannot map virtual allocated range (num ranges = %lu)!\n", gKernelArgs.num_virtual_allocated_ranges);		}		// map range into the page table		map_range(map->virtual_address, map->physical_address, map->length, map->mode);		total += map->length;	}	//printf("total mapped: %lu\n", total);	return B_OK;}