Beispiel #1
0
void sys_panic(char *msg) {
	asm volatile("cli");

	vid_puts("Kernel panic: ");
	vid_puts(msg);
	vid_putc('\n');

	while (1);
}
Beispiel #2
0
void init_process()
{
    vid_puts("Initial process started\n");

    vid_puts("Loading boot modules...\n");
    kmod_arch_boot_modules();

    while(1); // DON'T RETURN
}
Beispiel #3
0
/*
 * Restore tty modes, moves the cursor to the lower left hand
 * corner of the screen and resets the terminal into proper non-visual
 * mode.  Calling doupdate()/wrefresh() will resume visual mode.
 */
int
endwin(void)
{
    if (!(__m_screen->_flags & S_ENDWIN)) {
        (void) __m_mvcur(-1, -1, lines-1, 0, __m_outc);

        if (exit_ca_mode != NULL)
            (void) TPUTS(exit_ca_mode, 1, __m_outc);

        if (keypad_local != NULL)
            (void) TPUTS(keypad_local, 1, __m_outc);

        if (orig_colors != NULL)
            (void) TPUTS(orig_colors, 1, __m_outc);

        /* Make sure the current attribute state is normal. */
        if (ATTR_STATE != WA_NORMAL) {
            (void) vid_puts(WA_NORMAL, 0, (void *) 0, __m_outc);

            if (ceol_standout_glitch)
                curscr->_line[curscr->_maxx-1][0]._at
                |= WA_COOKIE;
        }

        (void) signal(SIGTSTP, SIG_DFL);
        __m_screen->_flags = S_ENDWIN;
    }

    (void) fflush(__m_screen->_of);
    (void) reset_shell_mode();

    return (OK);
}
Beispiel #4
0
void vid_putd(int n)
{
	char buf[11], buf2[11];
	int i, j = 0, neg = 0;

	if(n < 0)
	{
		n = -n;
		neg = 1;
	}

	i = 9;
	do
	{
		buf[i] = (n % 10) + '0';
		n /= 10;
		i--;
	}
	while (n != 0 && i >= 0);

	if(neg) buf2[j++] = '-';
	
	while(i++ < 9)
	{
		buf2[j++] = buf[i];
	}

	buf2[j] = 0;

	vid_puts(buf2);
}
Beispiel #5
0
void process_init()
{
	init_process_pid = process_create((int)(init_process),0,8,1);

	vid_puts("Initial process created: pid ");
	vid_putd(init_process_pid);
	vid_putc('\n');
}
Beispiel #6
0
static void
change_attr(chtype attr)
{
    if (p_opt) {
	vid_puts(attr, (short) 0, (void *) 0, outc);
    } else {
	vid_attr(attr, (short) 0, (void *) 0);
    }
}
Beispiel #7
0
int
vidputs(chtype ch, int (*putout)(int))
{
	int	code;
	cchar_t	cc;

	(void) __m_chtype_cc(ch, &cc);
	code = vid_puts(cc._at, cc._co, NULL, putout);

	return (code);
}
Beispiel #8
0
int
vidattr(chtype ch)
{
	int	code;
	cchar_t	cc;

	(void) __m_chtype_cc(ch, &cc);
	code = vid_puts(cc._at, cc._co, NULL, __m_putchar);

	return (code);
}
Beispiel #9
0
int kernel_main()
{
    arch_init();
    mm_init();
    process_init();
    kmod_init();

    vid_puts("\nspeck/" SPECK_ARCH " version " SPECK_VERSION "\n");
    vid_puts("  Built " SPECK_BUILD_DATE " by " SPECK_BUILD_USER "@"
             SPECK_BUILD_HOST "\n");

    vid_puts("\nDone initializing.\n");

    // TODO: one idle process per processor
    process_create((int)idle_process,0,0,1);

    // enable interrupts
    int_enable(INT_ENABLE_FLAGS_INIT);

    while(1);
}
Beispiel #10
0
int
vid_attr(attr_t attr, short pair, void *opts)
{
    int code;

#ifdef M_CURSES_TRACE
    __m_trace("vid_attr(%x, %d, %p)", attr, pair, opts);
#endif

    code = vid_puts(attr, pair, opts, __m_putchar);

    return __m_return_code("vid_attr", code);
}
Beispiel #11
0
void vid_puthex_internal(int n, int locks)
{
	char buf[9];
	int i;

	for(i=0;i<8;i++)
	{
		buf[7-i] = hex_digits[n & 0xf];
		n >>= 4;
	}
	buf[8] = 0;

	if(locks)
		vid_puts(buf);
	else
		vid_puts_internal(buf);
}