Date: Wed, 16 Jun 2004 17:55:18 +0900 From: Pyun YongHyeon <yongari@kt-is.co.kr> To: Mykel <Mykel@mWare.ca> Cc: freebsd-sparc64@freebsd.org Subject: Re: IT! WORKS! Message-ID: <20040616085518.GA8881@kt-is.co.kr> In-Reply-To: <40CFC2CF.8080509@mWare.ca> References: <40CFC0A0.1000604@mWare.ca> <20040616034055.GE26532@electra.cse.Buffalo.EDU> <40CFC2CF.8080509@mWare.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <http://www.kr.freebsd.org/~yongari> --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 <ddb/ddb.h> -#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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040616085518.GA8881>