/* * Init */ static int console_init(void) { struct bootinfo *bootinfo; machine_bootinfo(&bootinfo); cols = bootinfo->video.text_x; rows = bootinfo->video.text_y; esc_index = 0; attrib = 0x0F; vram = phys_to_virt((void *)VID_RAM); reset_cursor(); #if defined(DEBUG) && defined(CONFIG_DIAG_SCREEN) debug_attach(console_puts); #endif tty_init(&console_tty); /* init data */ console_tty.t_oproc = console_start; console_tty.t_winsize.ws_row = (u_short)rows; console_tty.t_winsize.ws_col = (u_short)cols; console_dev = tty_attach("console", &console_tty); tty_dev = tty_attach("tty", &console_tty); ASSERT(tty_dev); return 0; }
void diag_init(void) { struct bootinfo *bi; machine_bootinfo(&bi); vram = ptokv(VID_RAM); pos_x = 0; pos_y = 0; screen_x = bi->video.text_x; screen_y = bi->video.text_y; }
/* * Attach a tty to the tty list. */ void tty_attach(struct tty *tp) { /* Initialize tty */ memset(tp, 0, sizeof(struct tty)); memcpy(&tp->t_termios.c_cc, ttydefchars, sizeof(ttydefchars)); sem_init(&tp->t_input, 0, 0); sem_init(&tp->t_output, 0, 0); tp->t_iflag = TTYDEF_IFLAG; tp->t_oflag = TTYDEF_OFLAG; tp->t_cflag = TTYDEF_CFLAG; tp->t_lflag = TTYDEF_LFLAG; tp->t_ispeed = TTYDEF_SPEED; tp->t_ospeed = TTYDEF_SPEED; #if RICH struct bootinfo *bi; machine_bootinfo(&bi); tp->t_winsize.ws_row = (u_short)bi->video.text_y; tp->t_winsize.ws_col = (u_short)bi->video.text_x; #endif }