void systime_init() { extp_iterate(EXTP_SYSTIME, systime_extp_init); if(the_timesource == NULL || the_timesource->systime_us_func == NULL) fatal("no system time source found!\n"); if(the_timesource->systime_init_func) the_timesource->systime_init_func(); }
void pmem_init() { bmap_init(&first_bmap, first_storage, (sizeof(first_storage) * 8)); first_region.bmap = &first_bmap; first_region.start = 0; first_region.length = ((first_bmap.bits - (1 /* savety zone */)) * PMEM_PAGESIZE); first_region.next = NULL; pmem_region_head = &first_region; pmem_region_tail = pmem_region_head; spl_init(&pmem_lock); /* reserve the page at address zero, as most people don't * know how to handle it. rm_init() needs to spare this * page when reserving real mode memory! */ pmem_reserve(0, PMEM_PAGESIZE); /* from 4K to 0xa0000 (start of kernel memory) for * real mode */ pmem_reserve(PMEM_PAGESIZE, PMEM_PAGESIZE * 158); /* reserve the kernel's physical memory, so nobody * else tries to use it */ if(!pmem_reserve(0xA0000, (((size_t)&_core_lma_end) - 0xA0000))) { error("failed to protect physical lower and kernel memory\n"); } /* here we are sufficiently initialized, so virtual memory * can allocate physical memory for the initial mappings, * required to get the kernel heap working. this in turn * enables us, to allocate more memory to add additional * regions to the physical memory. */ kheap_init(); extp_iterate(EXTP_PMEM_REGION, pmem_iterate_extp); /* some debugging information */ pmem_region_t* current = pmem_region_head; while(current) { trace("pmem: %p - %p (%dKB)\n", current->start, current->start + current->length, current->length / 1024); current = current->next; } }
void vfs_init() { extp_iterate(EXTP_VFS_INIT, vfs_init_extp); }