Subject: wscons versus z8530tty
To: NetBSD tech-kern mailing list <>
From: Julian Coleman <>
List: tech-kern
Date: 02/08/2007 12:44:20

I've run into a problem trying to get wscons to work on a old sun-4, because
of the order in which devices attach.  On newer sparc and sparc64 machines,
zs* and zstty* attach before the frame buffers but on this sun-4, the frame
buffer attaches first.

The reason that the ordering causes a problem is because both the zstty code
and the wscons code set cn_tab->cn_dev.  If the frame buffer (and wsdisplay)
attach last, then cn_tab->cn_dev is set to the wscons device and all is fine.
However, if the zstty's attach last, then cn_tab->cn_dev is set to the zstty
device, and console input/output is broken (the rest of the code is assuming

I'm wondering what the best solution for this is.  Two possibilities come to
mind.  The first is to have some communication between zstty and wscons, so
that zstty_attach() doesn't set cn_tab->cn_dev if wsdisplay_emul_attach() has
already set it.  The second is to make the sparc MI code not go through the
zstty framework if we are using wscons and this is the console.

The second option would mean that there would be no changes to the MI code,
but I was wondering if any other ports that use zstty's will also need the
communication, so making the first option preferable.

Thought's appreciated.



PS.  A third option might be to fudge the issue by changing the device attach
order, but this doesn't seem to me to be the right way to do it.

  My other computer also runs NetBSD    /        Sailing at Newbiggin        /