Sunday, April 20, 2008

Where's my Jet Pack?

Has anyone brought up Hovercars or Personal Jet Packs at the 2020 Summit yet?
I believe we were promised these years ago, hello?

Wednesday, April 9, 2008

Installing FreeBSD on a SunPCi IIpro

This is not a full howto, just some of the differences installing FreeBSD on a SunPCi IIpro card based on the excellent howto by Emmanuel Kasper for installing NetBSD on the same card. I recommend reading that first.

Building the system


The first problem was dosboot, called bsdboot on the FreeBSD 6.3 CD (it seems to be the same utility), would not load the kernel. The utility is not present on the 7.0 CD and I assume it is deprecated. It would not work with either a 6.3 or 7.0 kernel. Bootstrapping had to be done via the network, in this case I used etherboot.

Rather than build my own etherboot bootrom I was reminded of the ROM-o-matic.net website.
  • Select sis900:sis900 NIC/ROM type at selection 1.
  • Select DOS executable ROM image format at selection 2.
  • Press the "configure" button for more options...
  • Untick any PXE options, the onboard NIC does not support it
  • Tick IMAGE_MULTIBOOT, IMAGE_FREEBSD, FREEBSD_KERNEL_ENV
  • I used NFS to retrieve the kernel rather than TFTP so untick DOWNLOAD_PROTO_TFTP and tick DOWNLOAD_PROTO_NFS and DEFAULT_PROTO_NFS

I renamed the resulting eb-5.4.3-sis900.com to eb.com to stop OpenDOS mangling the long filename and copied it to the DOS diskimage, commented out the device lines in config.sys, the sunpcnet lines in autoexec.bat and added c:\eb.com to the bottom of the autoexec.bat file.

For DHCP and NFS I used Solaris 9 on the machine the SunPCi was hosted in. I already knew how to use ISC-DHCP so I researched configuring the native DHCP server, which I will not go into here.

Installing a FreeBSD base system on the host machine was just a matter of exporting the directory I intended to use as the NFS share to a FreeBSD system and running

make world DESTDIR=$D
make distribution DESTDIR=$D

from /usr/src, $D being where the NFS filesystem was mounted.

I built a custom kernel with the following changes based on the generic kernel config.
Uncomment the hints line:

hints "GENERIC.hints"

Add "bootp" support for etherboot

options BOOTP
options BOOTP_NFSROOT

The kernel needs the following devices for the SunPCi hardware.
For the network adaptor,

device miibus
device sis

For USB,

device ohci
device usb

For sound,

device sound
device snd_t4dwave

I also removed unneeded devices and options to keep it lean.

Assuming your kernel configuration file was saved as SUNPCI, build and install the kernel with

make buildkernel KERNCONF=SUNPCI
make installkernel KERNCONF=SUNPCI DESTDIR=$D

Ignore any error messages as the script tries to "chflags" files.

This is the dmesg from the SunPCi.

Notes on the base system


The machine the SunPCi IIpro card is mounted in is a Sun Blade 100. The base OS is Solaris 9 as the SunPCi IIpro is not supported by Solaris 10. I am aware of the hack to make it operate under Solaris 10, however I was experiencing a memory leak and crashes using it.

One problem was the Xvnc supplied to view the SunPCi console. Running with default settings it used over 25% CPU doing nothing except running in the background. I changed the size and resolution in /etc/Master.ini:

CmdLineArgs=-geometry "800x600" -depth 8

It consumes about 5% CPU with this setting in the background. Using the viewer, together the vncviewer and Xvnc processes use over 50% CPU. I don't know why this is so.

To save some memory on the base system I also edited /opt/SUNWspci2/bin/VNCStartup, commenting out the line starting an xterm and replacing dtwm with twm as the window manager.

/usr/openwin/bin/twm >&! /dev/null &

Running the system


Once I had a FreeBSD system up and running I installed some ports.

I have it running XDM in the background for remote X logins. Most X apps run adequately on it including even OpenOffice 2.4 built from ports last week.

One day I will put a BSD on the Sun Blade itself, a shame there is no BSD SunPCi driver yet...