void init0(void) { Mach *m = machp(); char buf[2*KNAMELEN]; m->externup->nerrlab = 0; /* * if(consuart == nil) * i8250console("0"); */ spllo(); /* * These are o.k. because rootinit is null. * Then early kproc's will have a root and dot. */ m->externup->slash = namec("#/", Atodir, 0, 0); pathclose(m->externup->slash->path); m->externup->slash->path = newpath("/"); m->externup->dot = cclone(m->externup->slash); devtabinit(); if(!waserror()){ snprint(buf, sizeof(buf), "%s %s", "AMD64", conffile); ksetenv("terminal", buf, 0); ksetenv("cputype", cputype, 0); if(cpuserver) ksetenv("service", "cpu", 0); else ksetenv("service", "terminal", 0); ksetenv("pgsz", "2097152", 0); // no longer. confsetenv(); poperror(); } kproc("alarm", alarmkproc, 0); //debugtouser((void *)UTZERO); touser(sp); }
void kernel_init(multiboot_info_t *mboot_info) { extern char __start_bss[], __stop_bss[]; memset(__start_bss, 0, __stop_bss - __start_bss); /* mboot_info is a physical address. while some arches currently have the * lower memory mapped, everyone should have it mapped at kernbase by now. * also, it might be in 'free' memory, so once we start dynamically using * memory, we may clobber it. */ multiboot_kaddr = (struct multiboot_info*)((physaddr_t)mboot_info + KERNBASE); extract_multiboot_cmdline(multiboot_kaddr); cons_init(); print_cpuinfo(); printk("Boot Command Line: '%s'\n", boot_cmdline); exception_table_init(); cache_init(); // Determine systems's cache properties pmem_init(multiboot_kaddr); kmem_cache_init(); // Sets up slab allocator kmalloc_init(); hashtable_init(); radix_init(); cache_color_alloc_init(); // Inits data structs colored_page_alloc_init(); // Allocates colors for agnostic processes acpiinit(); topology_init(); kthread_init(); /* might need to tweak when this happens */ vmr_init(); file_init(); page_check(); idt_init(); kernel_msg_init(); timer_init(); vfs_init(); devfs_init(); train_timing(); kb_buf_init(&cons_buf); arch_init(); block_init(); enable_irq(); run_linker_funcs(); /* reset/init devtab after linker funcs 3 and 4. these run NIC and medium * pre-inits, which need to happen before devether. */ devtabreset(); devtabinit(); #ifdef CONFIG_EXT2FS mount_fs(&ext2_fs_type, "/dev/ramdisk", "/mnt", 0); #endif /* CONFIG_EXT2FS */ #ifdef CONFIG_ETH_AUDIO eth_audio_init(); #endif /* CONFIG_ETH_AUDIO */ get_coreboot_info(&sysinfo); booting = 0; #ifdef CONFIG_RUN_INIT_SCRIPT if (run_init_script()) { printk("Configured to run init script, but no script specified!\n"); manager(); } #else manager(); #endif }
void init0(void) { int i; char buf[2*KNAMELEN]; assert(up != nil); up->nerrlab = 0; barriers(); intrack(~0); clrmchk(); barriers(); spllo(); /* * These are o.k. because rootinit is null. * Then early kproc's will have a root and dot. */ up->slash = namec("#/", Atodir, 0, 0); pathclose(up->slash->path); up->slash->path = newpath("/"); up->dot = cclone(up->slash); dmainit(); /* starts dma kprocs */ devtabinit(); if(!waserror()){ snprint(buf, sizeof(buf), "power %s", conffile); ksetenv("terminal", buf, 0); ksetenv("cputype", "power", 0); if(cpuserver) ksetenv("service", "cpu", 0); else ksetenv("service", "terminal", 0); /* virtex configuration */ ksetenv("nvram", "/boot/nvram", 0); ksetenv("nvroff", "0", 0); ksetenv("nvrlen", "512", 0); ksetenv("nobootprompt", "tcp", 0); poperror(); } for(i = 0; i < nconf; i++){ if(confval[i] == nil) continue; if(confname[i][0] != '*'){ if(!waserror()){ ksetenv(confname[i], confval[i], 0); poperror(); } } if(!waserror()){ ksetenv(confname[i], confval[i], 1); poperror(); } } kproc("alarm", alarmkproc, 0); if (securemem) kproc("mutate", mutateproc, 0); else print("no secure memory found\n"); /* * The initial value of the user stack must be such * that the total used is larger than the maximum size * of the argument list checked in syscall. */ sync(); isync(); touser(sp); }