summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-03-10 11:28:54 +0000
committered <ed@FreeBSD.org>2009-03-10 11:28:54 +0000
commitb2737cb9ed157467f6f1fb032e215d056013388e (patch)
tree81b513a4d1a972e44f59deb62bedb21c604e26ae /sys/pc98/cbus
parenta1473abcc3d703c250444d1573d707ca964bd614 (diff)
downloadFreeBSD-src-b2737cb9ed157467f6f1fb032e215d056013388e.zip
FreeBSD-src-b2737cb9ed157467f6f1fb032e215d056013388e.tar.gz
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)
Diffstat (limited to 'sys/pc98/cbus')
-rw-r--r--sys/pc98/cbus/scterm-sck.c10
1 files changed, 9 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud