Subject: XFree86
To: None <port-sparc@netbsd.org>
From: Michael Lorenz <macallan@netbsd.org>
List: port-sparc
Date: 10/01/2005 20:09:11
--Signature_Sat__1_Oct_2005_20_09_11_-0400_2+B69dVvtb9m=rUl
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

I just committed a few Makefile changes to enable building XFree86 on
NetBSD/sparc. The reason is to have usable X on JavaStation NC / Krups.
An obvious side effect is that it will be usable by others too, the
caveat is that XFree86 needs wscons.

wscons support is available in -current for the following hardware:
- JavaStation NC / Krups with igsfb
- SPARCbook 3GX and similar machines with pnozz
- more or less any SBus SPARCstation with GX/TGX/GX+/TGX+ using the
cgsix driver

To build a kernel with wscons support you need to change a few things in
your kernel config ( Krups uses wscons by default - no changes necessary
)

Remove these lines:
kbd0   at zs1 channel 0        # keyboard
ms0    at zs1 channel 1        # mouse

... and replace them with this:
zstty*  at zs1 channel ?        # mouse/keyboard

kbd0    at zstty?
ms0     at zstty?

wskbd*          at kbd? console ?
wsmouse*        at ms?

It should work on any sun4m, I'm not sure about sun4c though.

Then add this:
# make sure the console display is always wsdisplay0
wsdisplay0      at wsemuldisplaydev? console 1
wsdisplay*      at wsemuldisplaydev?

That's it for the kernel and yes, it looks exactly the same as on
sparc64. Some further customization:

options         WSEMUL_SUN              # sun terminal emulation
options         WS_DEFAULT_FG=3DWSCOL_BLACK
options         WS_DEFAULT_BG=3DWSCOL_LIGHT_WHITE
options         WS_KERNEL_FG=3DWSCOL_GREEN
options         WS_KERNEL_BG=3DWSCOL_LIGHT_WHITE
options         WSDISPLAY_COMPAT_USL            # VT handling
options         WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
options         FONT_GALLANT12x22               # PROM font look-alike

this gives a white background, black text and green kernel output. You
may want to use =20
options         WSEMUL_VT100
to get vt100 emulation with colour support and all that.

You'll have to change /etc/ttys too, add something like this:
ttyE0   "/usr/libexec/getty std.9600"   sun     on  secure
ttyE1   "/usr/libexec/getty std.9600"   sun     on  secure
ttyE2   "/usr/libexec/getty std.9600"   sun     on  secure
ttyE3   "/usr/libexec/getty std.9600"   sun     on  secure

pnozz and cgsix also support virtual consoles, you can switch with
STOP - Function key ( F1 - first console and so on )
On a SPARCbook use Alt - Function key.

To get X to work you need a config file. With pnozz and cgsix that's
easy - run X -configure as root and it will dump an almost usable config
file into root's home dir, you'll need to add=20
DefaultDepth 8
to the "Screen" section though, XFree defaults to 16bit colour but both
cgsix and pnozz do only 8bit. Pnozz can do more but the current driver
doesn't know about it. If you have more than one cgsix you'll end up
with a multihead configuration - works just fine on sparc64, should work
on sparc too. The config file goes into /etc/X11 as XF86Config.
For Krups it's a little more complicated, a config file that works for
me can be found here:
ftp://ftp.netbsd.org/pub/NetBSD/misc/macallan/sparc/Krups/XF86Config
It needs a very recent kernel though, 'very recent' as in 'no older than
last night'.
pnozz and cgsix have accelerated drivers in XFree86, Krups uses the
generic wscons framebuffer driver (wsfb) so far, but at least you'll get
a hardware cursor and at 8bit it's surprisingly usable.

Another caveat - XFree86 supports other framebuffers as well, it may
even be able to use them but that's completely untested. So far the only
SBus framebuffers with wscons support are cgsix and pnozz.

/usr/X11R6/bin/X still points to Xsun, you may want to change that to
XFree86 if you're going to play with it.

have fun
Michael

--Signature_Sat__1_Oct_2005_20_09_11_-0400_2+B69dVvtb9m=rUl
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQz8lKMpnzkX8Yg2nAQLyKwgAnogRRUywelipHOjak2Fk6l082bkMvItT
tFpXQQ4dcs+kLMMEeNZ0iS+XvOCYio6nscFQn5CwYhTA/UMKtCZ22yeNwX5ivV0D
kpcO7XobNDxYxikOKltHwvdnVYQSkm1940pt/900dyVQwaIffeyEdaCbK5SdCttt
IacLV+vdMo5LYAOsPltCzhllILHwVq/OXJz7QkEiRmcLoau4YIeOGudV5n4Xr0yI
VqwVH2g6o1uPQ03g38DRc4+TIZY2rCCUdfkPw4JvJV5+LykCUUIWoiEvtO4cJjih
UetMbblEAmgLziiR82YD9ekgMGA0Vf1gM6hMA+nF8BRhQ5YEJyULBw==
=tVhG
-----END PGP SIGNATURE-----

--Signature_Sat__1_Oct_2005_20_09_11_-0400_2+B69dVvtb9m=rUl--