void init_startup_thread(uint32_t arg) { /* Threads have arguments for functions they run, we don't need any. Silence the compiler warning by using the argument. */ arg = arg; process_id_t pid; kprintf("Mounting filesystems\n"); vfs_mount_all(); kprintf("Initializing networking\n"); network_init(); if(bootargs_get("initprog") == NULL) { kprintf("No initial program (initprog), dropping to fallback\n"); init_startup_fallback(); } kprintf("Starting initial program '%s'\n", bootargs_get("initprog")); pid = process_spawn(bootargs_get("initprog")); if (pid < 0) KERNEL_PANIC("Couldn't fit initial program in process table.\n"); process_join(pid); halt_kernel(); }
void init_startup_thread(uint32_t arg) { /* Threads have arguments for functions they run, we don't need any. Silence the compiler warning by using the argument. */ arg = arg; kprintf("Mounting filesystems\n"); vfs_mount_all(); kprintf("Initializing networking\n"); network_init(); if(bootargs_get("initprog") == NULL) { kprintf("No initial program (initprog), dropping to fallback\n"); init_startup_fallback(); } kprintf("Starting initial program '%s'\n", bootargs_get("initprog")); /* `process_start` no longer takes an executable as its argument, so we need to start initprog with `process_spawn`. */ process_id_t pid = process_spawn(bootargs_get("initprog")); if (pid < 0) { KERNEL_PANIC("Couldn't fit initial program in process table.\n"); } process_join(pid); /* The current process_start() should never return. */ KERNEL_PANIC("Run out of initprog.\n"); }
void init_startup_thread(uint32_t arg) { /* Threads have arguments for functions they run, we don't need any. Silence the compiler warning by using the argument. */ arg = arg; kprintf("Mounting filesystems\n"); vfs_mount_all(); if(bootargs_get("initprog") == NULL) { kprintf("No initial program (initprog), dropping to fallback\n"); init_startup_fallback(); } kprintf("Starting initial program '%s'\n", bootargs_get("initprog")); // Run Process-Init for at lave process table process_init(); process_spawn(bootargs_get("initprog"), NULL); }
void init_startup_thread(uint32_t arg) { /* Threads have arguments for functions they run, we don't need any. Silence the compiler warning by using the argument. */ arg = arg; kprintf("Mounting filesystems\n"); vfs_mount_all(); kprintf("Initializing networking\n"); network_init(); if(bootargs_get("initprog") == NULL) { kprintf("No initial program (initprog), dropping to fallback\n"); init_startup_fallback(); } kprintf("Starting initial program '%s'\n", bootargs_get("initprog")); process_run(bootargs_get("initprog")); /* The current process_run() should never return. */ KERNEL_PANIC("Run out of initprog.\n"); }