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...

Monday, January 28, 2008

Make fortune files from the whatis database in FreeBSD

Fortune is a neat way to help learn bits of information so why not turn the whatis database into a fortune file to help discover some of the less used FreeBSD commands (or any other section of the man pages)?

If the whatis database does not exist run "makewhatis" as root, or if you don't have root access run "makewhatis -o whatis" to make your own personal copy. You also need the games distribution files installed.

Ok let's make fortunes...

To make the whole whatis database into a fortune file:

$ cat /usr/share/man/whatis | sed 's/$/\
\%/g' > whatis-fortune

$ /usr/games/strfile whatis-fortune whatis-fortune.dat


[Note that the sed command is split over two lines, type it exactly as shown.]

To make just one man section into a fortune file, section 1 in this example:

$ cat /usr/share/man/whatis | egrep "^.+\(1\) +- " | sed 's/$/\
\%/g' > whatis1-fortune

$ /usr/games/strfile whatis1-fortune whatis1-fortune.dat


Naturally substitute 1 with any man section number to make a different fortune file.

Test it with "fortune whatis1-fortune".

If everything is happy you can put it in your .profile (under the freebsd-tips fortune line of course) with the full path to the fortune files if you didn't put them in /usr/share/games/fortune.

Sunday, January 27, 2008

Why mead is an excellent choice for the casual brewer

Ok, I'll tell you how to brew some mead.

Throw one part honey, three parts water into a large vessel you can heat up. Pasteurise the mixture for about 15 minutes, cool it, throw in some yeast, then tip it into a carboy, whack on a bung with an airlock and leave it for a few months, racking once or twice if you wish.

That's the gist of it.

I won't go into details, but there is much more you can do with making mead. I just wanted to point out that it's one of the easiest things to brew from original ingredients.

I guess I just like simple and elegant.