From owner-freebsd-hackers Mon Jan 27 22:58:49 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id WAA24416 for hackers-outgoing; Mon, 27 Jan 1997 22:58:49 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id WAA24403 for ; Mon, 27 Jan 1997 22:58:43 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id RAA13038; Tue, 28 Jan 1997 17:52:44 +1100 Date: Tue, 28 Jan 1997 17:52:44 +1100 From: Bruce Evans Message-Id: <199701280652.RAA13038@godzilla.zeta.org.au> To: dgy@rtd.com, Shimon@i-Connect.Net Subject: Re: suggestion for kernel printk() ? Cc: bde@zeta.org.au, freebsd-hackers@freefall.freebsd.org Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> Yes. But all of those mechanisms tie in to provide flow control for >> regular console output functions. Apparently, however, this happens >> at a higher level than I had hoped/assumed (i.e. more stuff has to be >> functional before this mechanism works). > >Unfortunately, this makes some sense, as there are no interrupts during >some of this. I solved this porblems on a SVR4.2 port by providing the >UART witha polled mode. Added a walloping 20 lines of code to the driver. >What that means in a PC console I really do not know. Real computers >should have only serial consoles. Preferebly an LA34. Right? :-) It takes 200 lines in sio.c.. >> > output. No? Maybe a (oops :-) SysV-like mechanism where print{kf} go >to >> > a circular buffer andanother mechanism dumps it to ``the console''. >> > If you like ugly, (if memory serves), you can either pass an additional >arg >> > to the output routine (A la Linux) or designate the first character in >the >> > string to tell what to do, as in ~==console and buffer, !=bufferonly, >etc. In BSD, printf output goes to the message buffer and the console. The syscons driver also duplicates it in the scrollback buffer. The problem is getting at this output. Scrollback doesn't work at the panic prompt. I think it was broken when syscons started using timeouts for screen updates. >> I was suggesting having printk() examine the keyboard buffer for a pending > >I am so new to FreeBSD that I did not even see that there is a printk(). >How does that relate to printf() is see everywhere? printk() doesn't exist. There is also uprintf() for printing to the controlling tty of the current process, tprintf() for printing to the controlling terminal of the specified session, ttyprintf() for printing to the specified terminal, and log() which prints to the console if the log device is not open. printf() and log() are supposed to work in interrupt handlers so they normally have to use polled output. The others are higher level. Bruce