How to run NetBSD on a SPARCbook 3
Saturday, December 3, 2005 8:40:59 PM
So, the first questions will probably be:
- What hardware is supported?
- What am I going to lose compared to Solaris?
- What will I gain over Solaris?
The answers for question one:
- NetBSD/sparc runs on the SPARCbook 3GX, 3TX and probably 3GS.
- the graphics chip is supported, including acceleration, for both the console and XFree86. X is currently limited to 8 bit but that's going to change.
- audio is supported, currently output only but that's going to change
- PCMCIA works. You can use any PCMCIA device supported by NetBSD which is quite a lot more than what you could do with Solaris. I'm using a wlan card for instance.
- CPU power management. No more overheating.
- hardware sensors are exposed via envsys. Currently that's internal temperature, battery- and DC-in voltage.
- pressing the power button will initiate a shutdown
- the usual Sun-hardware, like esp SCSI, lance ethernet and so on is supported.
... question two ...
- Support for more than 8 bit in X. I'm working on that one though.
- SunISDN. I have documentation for the ISDN part but no ISDN line so someone else will have to write the driver.
- Audio input. Coming soon.
- Suspend to disk. NetBSD has no generic suspend-to-disk support like Solaris does.
- the external monitor port doesn't work yet
- external mice don't work yet. The microcontroller detects them but doesn't forward any data for some reason
And question three:
- You can only run old versions of Solaris, usually 2.6 and sometimes 7. They won't get security fixes forever. NetBSD will support the SPARCbooks as long as it supports SPARCs.
- NetBSD boots much faster
- Solaris supports only a handful PCMCIA devices, NetBSD is MUCH better here.
- NetBSD gives you more control over the hardware ( think envsys )
- Our console is better. We use the blitter for everything while Solaris uses the PROM to draw everything in software. We have virtual consoles.
- binary packages for NetBSD/sparc just work.
- no need to update all the broken or outdated system tools with superior free versions or to install many of those that don't come with Solaris ( think tar, gzip, bzip2, gcc and so on )
What you need to run it:
- NetBSD/sparc -current. Grab a build from releng.netbsd.org
- kernel source. Get it via CVS or from releng.
First, install -current. The TADPOLE3GX kernel should just work.
Second, build a wscons kernel.
To do that add these things to the TADPOLE3GX config file in src/sys/arch/sparc/conf/:
options WSEMUL_VT100 options WSDISPLAY_COMPAT_RAWKBD # can get raw scancodes options WSDISPLAY_CUSTOM_OUTPUT # wsconsctl(8) options WS_DEFAULT_FG=WSCOL_BLACK options WS_DEFAULT_BG=WSCOL_LIGHT_WHITE options WS_KERNEL_FG=WSCOL_GREEN options WS_KERNEL_BG=WSCOL_LIGHT_WHITE options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls options WSDISPLAY_DEFAULTSCREENS=1 options SPARCBOOK_CMD # enable screen switching with lAlt-Fn options FONT_BOLD8x16 # a somewhat smaller font
Remove the old console stuff since it will collide with wscons:
## Use a faster console than the PROM's slow drawing routines. Not needed ## for headless (no framebuffer) machines. options RASTERCONSOLE # fast rasterop console #options FONT_GALLANT12x22 # the console font options FONT_BOLD8x16 # a somewhat smaller font options RASTERCONSOLE_FGCOL=WSCOL_BLACK options RASTERCONSOLE_BGCOL=WSCOL_WHITE
And this has to go too:
zs1 at obio0 # sun4m kbd0 at zs1 channel 0 # keyboard ms0 at zs1 channel 1 # mouse
Add the actual drivers:
zs1 at obio0 # sun4m zstty* at zs1 channel ? # mouse/keyboard kbd0 at zstty? ms0 at zstty? wskbd* at kbd? console ? wsmouse* at ms? wsdisplay* at pnozz? console ? pseudo-device wsmux # mouse and keyboard multiplexor pseudo-device wsfont
Probably add or remove PCMCIA drivers.
Now build the kernel, put it into / but make sure you don't overwrite the old kernel in case something goes wrong. Before trying to boot it make sure that:
- /dev/ttyE0...n and /dev/ttyEcfg exist. /dev/MAKEDEV should create them.
- you have entries for ttyE1-4 to /etc/ttys, disable the entry for /dev/console. They should look like this:
ttyE0 "/usr/libexec/getty std.9600" xterm-color on secure ttyE1 "/usr/libexec/getty std.9600" xterm-color on secure ttyE2 "/usr/libexec/getty std.9600" xterm-color on secure ttyE3 "/usr/libexec/getty std.9600" xterm-color on secure
- you can login via network in case something goes wrong
- you have a line saying wscons=yes in your /etc/rc.conf
Boot the new kernel and cross fingers.
When things work you can set up X. First make sure /usr/X11R6/bin/X points to /usr/X11R6/bin/XFree86 ( it defaults to Xsun ), then run 'X -configure' as root, that will write an almost working config file into /root/XF86Config.new. Add 'DefaultDepth 8' to the "Screen" section and put the config file to /etc/X11/XF86Config. That's it.