Subject: Console device flamage
To: Chris Torek <torek@BSDI.COM>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 01/22/1997 16:20:33
>Sender: tech-kern-owner@NetBSD.ORG
>Precedence: list
>Delivered-To: tech-kern@NetBSD.ORG

>>Were you referring to probing the SBI nexus space for UBAS or probing
>>the Unibus I/O register space on the UBA?

>The latter -- the 16 SBI nexi tell you what is plugged into them,
>if anything. 

Yes, that's why the SBI is a direct bus :).

> On the 780, though, there is a special Unibus error
>register in the adapter, that gets set in some case I never really

Is it worth digging out?

>>Even with sanely-designed hardware, consoles are a `problem child' for
>>the autoconfiguration code ...

>Well, no and yes -- consider the Vax, for instance, where the console
>is always present and does not need to be configured as a tty -- it is
>just there.  (If you need to hook it into the rest of the system, e.g.,
>to do statistics, you do this much like a pty pseudo-device attach.)

Vaxes have a `mainframe' sense of console. The console device is
accessed not as a device but (IIRC) by mtpr/mtpr insns to
privileged-mode CPU registers.  The registers may end up getting
mapped to a UART chip somewhere (e.g., by microcode and/or an ll/03 or
8085), but that's not visible to software.

cgd and I were referring to `serial consoles' on 1980s-style
workstation hardware, where the `system console' is just another 
serial device, hanging off a system bus. Frequently the system console
is simply one port on a multi-port UART or I/O  device.  Graphics
consoles are similar: one needs to find a framebuffer device,
initialize it,  and map the FB into kernel-virtual address space.
One also needs to manage a keyboard-input UART, which is either
hanging off the motherboard, or register-mapped on an I/O bus,
as in the qvss(vcb01) or qdss(vcb02).

Chris, perhaps a better analogy is to imagine a microvax with no
serial console on the CPU,  but where instead the kernel needs
to find and initialize a `console' device that's either a graphics
card, or the first serial port on a dhu.

The vax-style sense in which you think of a `console' is valid for
vaxes, and microprocessor-based implemntations of mainframe
architectures, but (AFAIK) not for _any_ `true' microprocessor based
system.  Microprocessors just don't do consoles on-chip.  To find
a console, a kernel  has to `bootstrap' configuration: possibly
find and map an I/O bus,  find and map a framebuffer, and find
and initialize some kind of input device (i.e., UART). 
All this before main() can print a copyright notice, let alone before
malloc() is up  or autoconfiguration runs.

If we're still disagreeing, hope at least the posistions are clearer.