Example #1
0
/* initialize the console I/O stuffs */
int conio_init(int ttymode, int inputmode) {
	conio_ttymode = ttymode;
	conio_inputmode = inputmode;

	switch (conio_ttymode) {
		case CONIO_TTY_PVR:
#ifdef GFX
			conio_draw_init();
#endif
			break;
		case CONIO_TTY_STDIO:
			break;
		case CONIO_TTY_SERIAL:
			conio_serial_fd = 1;
			break;
		default:
			assert_msg( false, "Unknown CONIO TTY mode" );
			conio_ttymode = CONIO_TTY_PVR;
			break;
	}
	assert_msg( conio_inputmode == CONIO_INPUT_LINE, "Non-Line input modes not supported yet" );

	conio_input_init();
	if (conio_ttymode == CONIO_TTY_PVR) {
		conio_clear();
		conio_gotoxy(0, 0);
	}

	ft_mutex = sem_create(1);

	/* create the conio thread */
	conio_exit = 0;
	if (thd_create(conio_thread, 0) < 0)
		return -1;

	/* Wait for it to actually start */
	while (!conio_entered)
		thd_pass();
	
	return 0;
}
Example #2
0
void erase_buffer() {
	conio_gotoxy (1,25);
	conio_clreol();
}