From owner-p4-projects@FreeBSD.ORG Tue Nov 25 19:46:51 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 11B281065674; Tue, 25 Nov 2008 19:46:51 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C92A4106564A for ; Tue, 25 Nov 2008 19:46:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B7C828FC1F for ; Tue, 25 Nov 2008 19:46:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mAPJkovK003082 for ; Tue, 25 Nov 2008 19:46:50 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mAPJkoO7003078 for perforce@freebsd.org; Tue, 25 Nov 2008 19:46:50 GMT (envelope-from ed@FreeBSD.org) Date: Tue, 25 Nov 2008 19:46:50 GMT Message-Id: <200811251946.mAPJkoO7003078@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 153552 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 19:46:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=153552 Change 153552 by ed@ed_dull on 2008/11/25 19:46:27 As an experiment, add libteken to the syscons source code. What's libteken? Our syscons driver uses a terminal type called cons25. There's nothing wrong with cons25, but the problem is that it isn't really compatible with other systems out there. For example, I SSH to my HP2626 switch from syscons, it won't work. libteken is an attempt to emulate an xterm-color. Eventually we should also place the UTF-8 handling inside libteken. libteken is simply a library that converts input (output from, say, a TTY) to drawing commands that can be used by syscons. There are a couple of reasons why we want to put this in a library: - Having a well-defined API that doesn't depend on syscons itself allows me to easily develop this in userspace. I've got a simple application built with ncurses that emulates a terminal inside xterm itself. - It's hard to do right. There are always very small edge cases that can mess up the rendering. If we only write it once, we could for example teach window(1) how to use it as well. - If we ever get multiple console drivers, it's only a matter of building on top of libteken to get the terminal emulation working properly. So why did I choose xterm-color? It seems like this is the most commonly used terminal type. There are a lot of terminal-emulators that already use xterm-color. Even Mac OS X's Terminal.app just uses it. It's probably the safest approach. libteken is hardly finished. There are a lot of loose ends. The reason why I'm adding it to the MPSAFE TTY branch already is because I want to find out how efficient it is right now and if it can be fitted inside the syscons code. Affected files ... .. //depot/projects/mpsafetty/sys/conf/files#27 edit .. //depot/projects/mpsafetty/sys/dev/syscons/teken/teken.c#1 add .. //depot/projects/mpsafetty/sys/dev/syscons/teken/teken.h#1 add .. //depot/projects/mpsafetty/sys/dev/syscons/teken/teken_internal.h#1 add .. //depot/projects/mpsafetty/sys/dev/syscons/teken/teken_state.c#1 add .. //depot/projects/mpsafetty/sys/dev/syscons/teken/teken_subr.c#1 add Differences ... ==== //depot/projects/mpsafetty/sys/conf/files#27 (text+ko) ==== @@ -1270,6 +1270,9 @@ dev/syscons/star/star_saver.c optional star_saver dev/syscons/syscons.c optional sc dev/syscons/sysmouse.c optional sc +dev/syscons/teken/teken.c optional sc +dev/syscons/teken/teken_state.c optional sc +dev/syscons/teken/teken_subr.c optional sc dev/syscons/warp/warp_saver.c optional warp_saver dev/tdfx/tdfx_linux.c optional tdfx_linux tdfx compat_linux dev/tdfx/tdfx_pci.c optional tdfx pci