Example #1
0
       int vfstestmain(kshell_t *kshell, int argc, char **argv)
        {

                KASSERT(kshell!=NULL);
                vfstest_main(1, NULL);
                return 0;

        }
Example #2
0
/**
 * The init thread's function changes depending on how far along your Weenix is
 * developed. Before VM/FI, you'll probably just want to have this run whatever
 * tests you've written (possibly in a new process). After VM/FI, you'll just
 * exec "/bin/init".
 *
 * Both arguments are unused.
 *
 * @param arg1 the first argument (unused)
 * @param arg2 the second argument (unused)
 */
static void *
initproc_run(int arg1, void *arg2)
{
        /* PROCS {{{ */
#ifdef __VM__
        int status;

        dbg(DBG_INIT, "do_init!\n");

        do_open("/dev/tty0", O_RDONLY);
        do_open("/dev/tty0", O_WRONLY);
        do_open("/dev/tty0", O_WRONLY);

        char *const argvec[] = { "foo", NULL };
        char *const envvec[] = { "bar", NULL };
        kernel_execve("/sbin/init", argvec, envvec);

        while (!do_waitpid(-1, 0, &status));
        do_exit(0);
#endif

#ifdef __DRIVERS__

        /* If we do not have VM yet, run the kernel shell */
        kshell_t *kshell;

        /* Create kernel shell on TTY 0 */
        kshell = kshell_create(0);
        if (NULL == kshell)
                panic("init: Couldn't create kernel shell\n");

        while (kshell_execute_next(kshell));
        kshell_destroy(kshell);
#endif
        /* PROCS }}} */
    
    
#ifdef __VFS__
        /*TEST VFS*/
        vfstest_main(1,NULL);
        do_exit(0);
#endif

        return NULL;
}
Example #3
0
File: kmain.c Project: lee4sj/brown
/**
 * The init thread's function changes depending on how far along your Weenix is
 * developed. Before VM/FI, you'll probably just want to have this run whatever
 * tests you've written (possibly in a new process). After VM/FI, you'll just
 * exec "/bin/init".
 *
 * Both arguments are unused.
 *
 * @param arg1 the first argument (unused)
 * @param arg2 the second argument (unused)
 */
static void *
initproc_run(int arg1, void *arg2)
{
	dbg(DBG_CORE, "running initproc_run\n");

	/* TESTS */
	my_proctest();
	my_drivertest();
	my_s5fstest();
	my_vmtest();

	vfstest_main(1, NULL);

#ifdef __VM__
	int status;
	char *const argv[] = { "hello", NULL };
	char *const envp[] = { "world", NULL };

	do_open("/dev/tty0", O_RDONLY);
	do_open("/dev/tty0", O_WRONLY);
	do_open("/dev/tty0", O_WRONLY);

	kernel_execve("/sbin/init", argv, envp);

	while (!do_waitpid(-1, 0, &status));
	do_exit(0);
#endif

	/* KSHELL */
	int err = 0;
	kshell_t *ksh = kshell_create(0);
	KASSERT(ksh && "did not create a kernel shell as expected");

	while ((err = kshell_execute_next(ksh)) > 0);
	KASSERT(err == 0 && "kernel shell exited with an error\n");
	kshell_destroy(ksh);

        return NULL;
}