Installing FreeBSD

From Soekris Info Wiki

Jump to: navigation, search

There are two ways to install FreeBSD on a Soekris box. The Soekris comBIOS doesn't support booting from CDROM drives, but you can prepare your disk image on another system, or you can install directly to the Soekris box over the LAN using the PXE network boot procedure.

Note: FreeBSD 6.3R requires comBIOS version 1.32i on the net5501, or the boot will hang when first attempting DMA.

Contents

Compact flash

  • NanoBSD is a shell script that creates a bootable compact flash image from the FreeBSD sources. NanoBSD gives you control of which features you add to save space. The resulting image is targeted for half of the CF card, allowing alternating in place upgrades to the other half. It was written by Soekris-Tech regular Poul-Henning Kamp.
  • Ultradesic.com (mirror) has a detailed tutorial on an alternative way to create and install the CF image.
  • BarryODonovan.com has a howto on installing FreeBSD to a CF card using VirtualBox and some necessary post-installation changes for it to boot on a Soekris net4801-48 box.
  • More on VirtualBox and installing FreeBSD.

Net boot

FreeBSD supports installing over the network using PXE net boot functionality of the Soekris BIOS.

Kernel customization

The FreeBSD GENERIC kernel should boot your Soekris, however there are several Soekris kernel optimizations that can be made. See the handbook for general kernel customization instructions. The following Soekris and AMD related options exist (from /usr/src/sys/i386/conf/NOTES):

  • CPU_SOEKRIS enables support www.soekris.com hardware
  • CPU_ELAN enables support for AMDs ElanSC520 CPU
    • CPU_ELAN_PPS enables precision timestamp code
    • CPU_ELAN_XTAL sets the clock crystal frequency in Hz
  • CPU_GEODE is for the SC1100 Geode embedded processor - This option is necessary because the i8254 timecounter is toast.

net5501

Start with the GENERIC kernel configuration file. Add "options CPU_SOEKRIS" and "options CPU_GEODE". You should also comment out or delete all device entries that aren't on the net5501 and that you're not likely to add. You will likely want to remove all RAID controllers, SCSI and FireWire related devices. You can remove all wired and wireless network interfaces, except miibus and vr, unless you have added NICs. You can even remove the USB uhci to save a few more bytes. "KVM" devices can also go since there is only a serial console, so remove atkbdc, atkbd, psm, vga, splash and sc. Be sure to keep sio. Note that if you keep umass (in USB section), you'll need scbus and da from the SCSI section.

net6501

The net6501 works with FreeBSD in either 32-bit mode (i386) as other Soekris machines do, but also in 64-bit mode: the amd64 64-bit build of FreeBSD works, but not with the standard GENERIC kernel (at least not with FreeBSD-9.0 or FreeBSD-9.1). You need to build a special kernel configuration in /usr/src/sys/amd64/conf that contains the line "device mptable" and then build a kernel with that option enabled... the resulting kernel will boot on the net6501 in 64-bit mode without any problem.

You can find a tarball with FreeBSD 9.0-RELEASE for the net6501, containing the required kernel files (boot/*), the NET6501 kernel configuration, and the boot.config file needed to boot from serial console at http://sivit.rax.org/NET6501.tgz.

FreeBSD10 NanoBSD on a Soekris net6501 describes installing NanoBSD 10 on a 6501 using a VirtualBox build environment and USB target.

Patch for PATA hard disk errors on FreeBSD 7.x and 8.x

The net5501 supports SATA and PATA disks: you just need to order the right cable or mounting kit. With FreeBSD, SATA disks work normally, but PATA hard disks are a problem due to the cable type being mis-detected. So after installing FreeBSD on a PATA disk, you will probably see a message like:

       kernel: ad0: WARNING - READ_DMA UDMA ICRC error (retrying request) LBA=121272839

This is because FreeBSD's ATA subsystem auto-detects the maximum drive speed, and gets it wrong! It sets UDMA100, which is slightly too fast, giving intermittent errors. If this happens to you, the first thing to do is to slow things down temporarily:-

       atacontrol mode ad0 udma66

This lasts until the next reboot. Now you can safely patch the ATA driver using Martin Johnson's unofficial patch. The file to patch is /usr/src/sys/dev/ata/ata-all.c and the patch file is here.

Rebuild the kernel using make buildkernel && make installkernel. Finally, edit /boot/loader.conf and add the line: hw.ata.ata_dma_limit="4", and reboot.

FreeBSD 8.2 PATA Disk Fix

This problem should be solved by an official fix from FreeBSD 8.2 onwards. You should be able to edit /boot/device.hints and add the line: hint.ata.0.mode="UDMA66" (assuming a PATA hard disk on IDE channel 0), then reboot.

FreeBSD 8.1 users might be able to use the code from FreeBSD 8.2 by taking Alexander Motin's official patches. The files affected are /usr/src/share/man/man4/ata.4, /usr/src/sys/dev/ata/ata-all.c and /usr/src/sys/dev/ata/ata-all.h.

Personal tools