From owner-p4-projects@FreeBSD.ORG Sat May 14 21:23:15 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D63D16A4D1; Sat, 14 May 2005 21:23:15 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE71416A4CE for ; Sat, 14 May 2005 21:23:14 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C261043D67 for ; Sat, 14 May 2005 21:23:14 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4ELNEKx032659 for ; Sat, 14 May 2005 21:23:14 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4ELNEAh032656 for perforce@freebsd.org; Sat, 14 May 2005 21:23:14 GMT (envelope-from marcel@freebsd.org) Date: Sat, 14 May 2005 21:23:14 GMT Message-Id: <200505142123.j4ELNEAh032656@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76986 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2005 21:23:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=76986 Change 76986 by marcel@marcel_nfs on 2005/05/14 21:23:02 Flesh-out the low-level console: o Reject characters outside the 7-bit unsigned range. o Process selected control characters. o Diplay glyphs for non-control characters. Trim the font table from the first 32 character ghyphs. Since we only accept 7-bit characters, we can also trim the table at the high end (not done yet). Backspace erases. Affected files ... .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#7 edit .. //depot/projects/tty/sys/dev/vtc/vtc_font.c#2 edit Differences ... ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#7 (text+ko) ==== @@ -93,21 +93,50 @@ { static int col = 0, row = 0; struct vtc_conout *vc = cp->cn_arg; - int width = vc->vtc_con_width; + int ch, width; u_char *glyph; + /* Sanity check. */ + if (c <= 0 || c >= 0x7f) + return; + + width = vc->vtc_con_width; switch (c) { - case 0x0a: + case 8: /* BS */ + if (col > 0) + col--; + ch = ' '; + break; + case 9: /* HT */ + col = (col + 7) & 7; + if (col >= 80) + col = 79; + ch = 0; + break; + case 10: /* LF */ + case 11: /* VT (processed as LF) */ + case 12: /* FF (processed as LF) */ col = 0; row++; + ch = 0; + break; + case 13: /* CR */ + col = 0; + ch = 0; break; default: - glyph = vtc_font_8x16 + (c * 16); + ch = (c >= ' ') ? c : 0; + break; + } + + if (ch != 0) { + glyph = vtc_font_8x16 + ((ch - ' ') * 16); vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)glyph, width * row * 16 + col * 8, 8, 16, 0, 7); - col++; - break; + if (c != 8) + col++; } + if (col >= 80) { col = 0; row++; ==== //depot/projects/tty/sys/dev/vtc/vtc_font.c#2 (text+ko) ==== @@ -27,31 +27,14 @@ #include __FBSDID("$FreeBSD$"); -unsigned char vtc_font_8x16[16*256] = { -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,129,165,129,129,189,153,129,129, -126,0,0,0,0,0,0,126,255,219,255,255,195,231,255,255,126,0,0,0,0,0,0,0,0, -108,254,254,254,254,124,56,16,0,0,0,0,0,0,0,0,16,56,124,254,124,56,16,0, -0,0,0,0,0,0,0,24,60,60,231,231,231,24,24,60,0,0,0,0,0,0,0,24,60,126,255, -255,126,24,24,60,0,0,0,0,0,0,0,0,0,0,24,60,60,24,0,0,0,0,0,0,255,255,255, -255,255,255,231,195,195,231,255,255,255,255,255,255,0,0,0,0,0,60,102,66, -66,102,60,0,0,0,0,0,255,255,255,255,255,195,153,189,189,153,195,255,255, -255,255,255,0,0,30,14,26,50,120,204,204,204,204,120,0,0,0,0,0,0,60,102, -102,102,102,60,24,126,24,24,0,0,0,0,0,0,63,51,63,48,48,48,48,112,240,224, -0,0,0,0,0,0,127,99,127,99,99,99,99,103,231,230,192,0,0,0,0,0,0,24,24,219, -60,231,60,219,24,24,0,0,0,0,0,128,192,224,240,248,254,248,240,224,192,128, -0,0,0,0,0,2,6,14,30,62,254,62,30,14,6,2,0,0,0,0,0,0,24,60,126,24,24,24, -126,60,24,0,0,0,0,0,0,0,102,102,102,102,102,102,102,0,102,102,0,0,0,0,0, -0,127,219,219,219,123,27,27,27,27,27,0,0,0,0,0,124,198,96,56,108,198,198, -108,56,12,198,124,0,0,0,0,0,0,0,0,0,0,0,254,254,254,254,0,0,0,0,0,0,24, -60,126,24,24,24,126,60,24,126,0,0,0,0,0,0,24,60,126,24,24,24,24,24,24,24, -0,0,0,0,0,0,24,24,24,24,24,24,24,126,60,24,0,0,0,0,0,0,0,0,0,24,12,254, -12,24,0,0,0,0,0,0,0,0,0,0,0,48,96,254,96,48,0,0,0,0,0,0,0,0,0,0,0,0,192, -192,192,254,0,0,0,0,0,0,0,0,0,0,0,40,108,254,108,40,0,0,0,0,0,0,0,0,0,0, -16,56,56,124,124,254,254,0,0,0,0,0,0,0,0,0,254,254,124,124,56,56,16,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,60,60,60,24,24,24,0,24,24, -0,0,0,0,0,102,102,102,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,108,254,108,108, -108,254,108,108,0,0,0,0,24,24,124,198,194,192,124,6,6,134,198,124,24,24, -0,0,0,0,0,0,194,198,12,24,48,96,198,134,0,0,0,0,0,0,56,108,108,56,118,220, +unsigned char vtc_font_8x16[16 * (256 - 32)] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,24,60,60,60,24,24,24,0,24,24,0,0,0,0, +0,102,102,102,36,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,108,108,254,108,108,108,254,108,108,0,0,0,0, +24,24,124,198,194,192,124,6,6,134,198,124,24,24,0,0, + +0,0,0,0,194,198,12,24,48,96,198,134,0,0,0,0,0,0,56,108,108,56,118,220, 204,204,204,118,0,0,0,0,0,48,48,48,96,0,0,0,0,0,0,0,0,0,0,0,0,0,12,24,48, 48,48,48,48,48,24,12,0,0,0,0,0,0,48,24,12,12,12,12,12,12,24,48,0,0,0,0, 0,0,0,0,0,102,60,255,60,102,0,0,0,0,0,0,0,0,0,0,0,24,24,126,24,24,0,0,0,