Subject: Re: serial console
To: None <port-i386@NetBSD.ORG>
From: Greg A. Woods <woods@most.weird.com>
List: port-i386
Date: 06/06/1998 22:53:58
[ On , June 6, 1998 at 22:31:36 (-0400), rvb@sicily.odyssey.cs.cmu.edu wrote: ]
> Subject: Re: serial console
>
> woods@most.weird.com (Greg A. Woods) writes:
> >
> > situations I think it makes more sense to probe for a keyboard, and if
> > none is found then assume that a specified serial port will be the
> > console.  It should not matter if there's a terminal attached at the
> 
> I guess that it depends on what you kind of usage you are assuming.

Indeed.  Most of the time when I want to use serial consoles it's in a
situation where the machines run in production and will be connected to
a terminal server or similar.  In the case of i386 machines I still need
to be able to quickly pop in a display card and keyboard (or at least
plug in a keyboard and connect a monitor), without changing the kernel,
in order to do maintenance and esp. to twiddle BIOS stuff (even SCSI
BIOS stuff), enable boot from floppy, etc.

Of course there's also the situation where there simply isn't a keyboard
and/or display on the machine.  That's (unfortunately) far less likely
for i386 though, esp. since you'll need to at least plug these in if you
ever have to get at the BIOS (and of course some BIOS versions won't
even boot without a display adapter).

> If you have no keyboard/monitor, then what you say makes sense.  If
> you use ddb a lot and need to see what is going wrong when X is
> running, then you want a serial line debugger even if there is a
> keyboard.  But, it wouldn't be that hard to add a few more options to
> the boot and allow the kind of probe that you suggest.

Ah, yes.  On the sparc port you specify with KGDBDEV what port the
kernel debugger runs on.  No doubt the same could be done on i386, if it
isn't already.  My guess is it would be much more difficult to get DDB
to point at an alternate device.

Of course on i386 if you're lucky and you've got the right options in
your system you'll still be able to switch virtual consoles to the
"true" console (i.e. away from the X11 session).  That's what I do on
FreeBSD too, and it works quite well unless the console driver gets
wedged (though that's likely to prevent DDB from working anyway).

> If I remember Mach correctly, we had the serial console and keyboard/monitor
> combined so that all output would do to both and input would be
> allowed at any time from either.  You could type keystrokes alternately
> from different keyboards and it would work.   (The trick was in the
> inner key scan loop, to add a "peek" to check the queue of the other
> device. [I don't think that we ran w/o a keyboard, though.])

My recollection is that's the way SunOS works too, at least that's what
it does when the "diagnostics" switch is turned on on a sun3.

-- 
							Greg A. Woods

+1 416 443-1734      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>