From owner-freebsd-sparc64@FreeBSD.ORG Wed Jun 16 08:56:49 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 127F916A4CE for ; Wed, 16 Jun 2004 08:56:49 +0000 (GMT) Received: from ns.kt-is.co.kr (ns.kt-is.co.kr [211.218.149.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04E9643D5C for ; Wed, 16 Jun 2004 08:56:48 +0000 (GMT) (envelope-from yongari@kt-is.co.kr) Received: from michelle.kt-is.co.kr (ns2.kt-is.co.kr [220.76.118.193]) (authenticated bits=128) by ns.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i5G8s1Ah083089 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 16 Jun 2004 17:54:01 +0900 (KST) Received: from michelle.kt-is.co.kr (localhost.kt-is.co.kr [127.0.0.1]) by michelle.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i5G8tJ1r009243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2004 17:55:19 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Received: (from yongari@localhost) by michelle.kt-is.co.kr (8.12.10/8.12.10/Submit) id i5G8tIed009242; Wed, 16 Jun 2004 17:55:18 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Date: Wed, 16 Jun 2004 17:55:18 +0900 From: Pyun YongHyeon To: Mykel Message-ID: <20040616085518.GA8881@kt-is.co.kr> References: <40CFC0A0.1000604@mWare.ca> <20040616034055.GE26532@electra.cse.Buffalo.EDU> <40CFC2CF.8080509@mWare.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: <40CFC2CF.8080509@mWare.ca> User-Agent: Mutt/1.4.1i X-Filter-Version: 1.11a (ns.kt-is.co.kr) cc: freebsd-sparc64@freebsd.org Subject: Re: IT! WORKS! X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: yongari@kt-is.co.kr List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2004 08:56:49 -0000 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 15, 2004 at 11:47:27PM -0400, Mykel wrote: > Ken Smith wrote: ... > > Now how about the console? how can I make typing at least practical on > here? I was hoping to use this as a desktop machine. > Because I got big trouble while testing TCP/UDP cksum offload fix for hme(4) on console, I touched ofw_console code. I stole the code from OpenBSD. It seems that now the console works as expected. No more 1 sec. pause needed to see correct typing on keyboard. Here is patch. I'm not familiar with tty code, so it may be just dirty hack or it may not work except my Ultra2. Regards, Pyun YongHyeon -- Pyun YongHyeon --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ofw_console.diff" --- sys/dev/ofw/ofw_console.c.orig Fri Jun 11 07:15:51 2004 +++ sys/dev/ofw/ofw_console.c Wed Jun 16 17:38:48 2004 @@ -42,7 +42,8 @@ #include -#define OFW_POLL_HZ 4 +#define OFW_POLL_HZ 100 +#define OFBURSTLEN 128 /* max number of bytes to write in one chunk */ static d_open_t ofw_dev_open; static d_close_t ofw_dev_close; @@ -125,7 +126,7 @@ ttychars(tp); tp->t_iflag = TTYDEF_IFLAG; tp->t_oflag = TTYDEF_OFLAG; - tp->t_cflag = TTYDEF_CFLAG|CLOCAL; + tp->t_cflag = TTYDEF_CFLAG; tp->t_lflag = TTYDEF_LFLAG; tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; ttsetwater(tp); @@ -162,6 +163,8 @@ return (ENXIO); } + /* XXX Should be replaced with callout_stop(9) */ + untimeout(ofw_timeout, tp, ofw_timeouthandle); ttyld_close(tp, flag); ttyclose(tp); @@ -179,16 +182,18 @@ static void ofw_tty_start(struct tty *tp) { + struct clist *cl; + int len; + u_char buf[OFBURSTLEN]; - if (tp->t_state & (TS_TIMEOUT | TS_TTSTOP)) { - ttwwakeup(tp); + + if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) return; - } tp->t_state |= TS_BUSY; - while (tp->t_outq.c_cc != 0) { - ofw_cons_putc(NULL, getc(&tp->t_outq)); - } + cl = &tp->t_outq; + len = q_to_b(cl, buf, OFBURSTLEN); + OF_write(stdout, buf, len); tp->t_state &= ~TS_BUSY; ttwwakeup(tp); --FL5UXtIhxfXey3p5--