From b2737cb9ed157467f6f1fb032e215d056013388e Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 10 Mar 2009 11:28:54 +0000 Subject: Make a 1:1 mapping between syscons stats and terminal emulators. After I imported libteken into the source tree, I noticed syscons didn't store the cursor position inside the terminal emulator, but inside the virtual terminal stat. This is not very useful, because when you implement more complex forms of line wrapping, you need to keep track of more state than just the cursor position. Because the kernel messages didn't share the same terminal emulator as ttyv0, this caused a lot of strange things, like kernel messages being misplaced and a missing notification to resize the terminal emulator for kernel messages never to be resized when using vidcontrol. This patch just removes kernel_console_ts and adds a special parameter to te_puts to determine whether messages should be printed using regular colors or the ones for kernel messages. Reported by: ache Tested by: nyan, garga (older version) --- sys/pc98/cbus/scterm-sck.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/pc98') diff --git a/sys/pc98/cbus/scterm-sck.c b/sys/pc98/cbus/scterm-sck.c index 2577f66..ce2324f 100644 --- a/sys/pc98/cbus/scterm-sck.c +++ b/sys/pc98/cbus/scterm-sck.c @@ -907,18 +907,24 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c) } static void -scterm_puts(scr_stat *scp, u_char *buf, int len) +scterm_puts(scr_stat *scp, u_char *buf, int len, int kernel) { term_stat *tcp; u_char *ptr; #ifdef KANJI u_short kanji_code; #endif + color_t backup; tcp = scp->ts; ptr = buf; outloop: scp->sc->write_in_progress++; + backup = tcp->cur_color; + if (kernel) { + tcp->cur_color.fg = SC_KERNEL_CONS_ATTR & 0x0f; + tcp->cur_color.bg = (SC_KERNEL_CONS_ATTR >> 4) & 0x0f; + } if (tcp->esc) { scterm_scan_esc(scp, tcp, *ptr++); @@ -1101,6 +1107,8 @@ ascii_end: sc_term_gen_scroll(scp, scp->sc->scr_map[0x20], tcp->cur_attr); + if (kernel) + tcp->cur_color = backup; scp->sc->write_in_progress--; if (len) goto outloop; -- cgit v1.1