<?xml version="1.0"?>
<!DOCTYPE webpage
PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
"http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd">

<webpage id="ports-cobalt-faq">
  <config param="desc"
  value="NetBSD/cobalt Frequently Asked Questions" />
  <config param="cvstag"
  value="$NetBSD: faq.xml,v 1.11 2010/09/26 13:54:00 kano Exp $" />
  <config param="rcsdate" value="$Date: 2010/09/26 13:54:00 $" />
  <head>
  <!-- Copyright (c) 2005
        The NetBSD Foundation, Inc.  ALL RIGHTS RESERVED. -->
    <title>NetBSD/cobalt Frequently Asked Questions</title>
  </head>
  <sect1 role="toc">
    <sect2 id="general-questions">
      <title>General Questions</title>
      <sect3 id="roadmap">
        <title>How do I install on my fresh Cobalt?</title>
        <para>The easiest way is to use the <ulink url="restorecd-howto.html">
        Restore CD</ulink>. If you don't have an i386 server or would like to
        install manually, use the following procedure.</para>
        <para>
          <itemizedlist>
            <listitem>set up an NFS server to serve a diskless filesystem
            and (optionally) the kernel</listitem>
            <listitem>repartition the drive, set up filesystems, and
            extract the sets with sysinst</listitem>
          </itemizedlist>
        </para>
        <para>To configure a server for netboot, see the 
        <ulink url="#netboot">NetBooting question</ulink>.
        </para>
        <para>The original disk in the cobalts came partitioned for
        Linux. The first FDISK partition is special (Linux root
        (/)) and must always exist. This is because the firmware
        looks to there for the kernel to boot. The remaining
        partitions can be removed and the space used for NetBSD.
        This partitioning is handled by sysinst during installation.</para>
        <para>The last step is to configure the system. 
        The &man.afterboot.8; man page and <ulink
        url="../../docs/guide/en/">The NetBSD Guide</ulink>
        can assist you in this.</para>
      </sect3>
      <sect3 id="buttons">
        <title>What can I do with the front panel buttons?</title>
        <para>
          <orderedlist>
            <listitem>
              <para>Hold the reset button ("pencil" button left of
              the keypad area on the front) while powering on to
              toggle on/off the firmware console on the serial
              port. It runs at 115200 bps, 8N1. After changing that
              setting, the machine needs another power-cycle to
              actually use the new setting.</para>
              <para>Press the space bar while the diagnostics run
              to halt the autoboot process.</para>
              <para>Type ? at the firmware prompt to get a list of
              commands.</para>
            </listitem>
            <listitem>Pressing and holding all four cursor buttons while
            powering on boots the kernel /usr/games/.doug
            .</listitem>
            <listitem>Pressing and holding the left and right cursor buttons
            while powering on executes the command 
            <command>bfd /boot/vmlinux.gz root=/dev/nfs
            nfsroot=/nfsroot</command>
            , resulting in a netboot. On RaQ 1s, the default
            kernel name is 
            <filename>vmlinux_RAQ.gz</filename>
            and on RaQ 2s, it is 
            <filename>vmlinux_raq-2800.gz</filename>
            .</listitem>
          </orderedlist>
        </para>
      </sect3>
      <sect3 id="netboot">
        <title>How do I netboot?</title>
        <para>Break into the debugger (see above) and then you can
        netboot with, e.g., the following command:</para>
<programlisting>
  # bfd /netbsd.gz nfsroot=/home/raq/root
</programlisting>
        <para>The firmware is picky in general, and especially about
        syntax, so if things fail mysteriously, try to conform to the
        conventions described above. For netbooting, you need to
        NFS-export the directory given to "
        <code>nfsroot=</code>
        ", and the named kernel ("
        <code>/netbsd.gz</code>
        ") needs to be executable and in that directory. You will
        also need to set up RARP and DHCP. Once the kernel is loaded,
        the data provided by DHCP is used to mount the root filesystem.
        Here is a DHCP entry that is known to work:</para>
<programlisting>
host raq {
        hardware ethernet 0:10:e0:0:52:62;	# raq MAC
        fixed-address 10.0.0.15;		# raq address
        filename "/netbsd.gz";			# kernel name in root-path
        option root-path "/home/raq/root";	# absolute dir on nfs server
        server-name="10.0.0.3";			# IP of nfs server
}
</programlisting>
        <para>See the 
        <ulink url="../../docs/network/netboot/">Diskless
        NetBSD HOW-TO</ulink> for more information about setting up
        a diskless environment.
        </para>
      </sect3>
      <sect3 id="kernel">
        <title>Are there any restrictions on the kernel that can be
        loaded?</title>
        <para>The firmware can only load gzipped kernels, and they
        have to be smaller than approximately 1000000/2500000 bytes
        compressed and uncompressed, respectively.</para>
        <para>Also, various models expect different filenames for
        the kernel as noted <ulink url="#preparehd">below</ulink>.</para>
      </sect3>
      <sect3 id="boot">
        <title>What's the process when booting from local
        disk?</title>
        <para>The disk is expected to have an "FDISK" style
        partition table with a "Linux native" (ID 131) partition
        with an ext2fs (old style, pre-Linux 2.2; see 
        <ulink
        url="http://mail-index.NetBSD.org/port-cobalt/2000/10/05/0000.html">
        this posting by Andrew Gillham</ulink>
        for more details).</para>
        <para>The default autoboot process loads a gzip'ed ELF
        kernel or boot loader from 
        <filename>/boot/vmlinux.gz</filename>
        (or 
        <filename>/boot/vmlinux_RAQ.gz</filename>
        or 
        <filename>/boot/vmlinux_raq-2800.gz</filename>)
        from the EXT2 filesystem on the first MBR partition on
        the primary disk.</para>
        <para>There is no provision for changing the boot path
        beyond disabling autoboot, and the kernel or the boot loader
        must always be gzip'ed.</para>
        <para>When there is no NetBSD disklabel on the disk, the
        four MBR partitions are mapped to [e-h].</para>
      </sect3>
      <sect3 id="otherkernel">
        <title>How can I boot a non-default kernel?</title>
        <para>NetBSD/cobalt has a native bootloader and uses it, so
        you can just specify an alternative kernel at the bootloader
        prompt.</para>
        <para>If you don't use the bootloader and are still loading
        your kernel directly, you can boot a non-default kernel (see 
        <ulink url="#boot">above</ulink>), with the following steps:</para>
        <para>
          <itemizedlist>
            <listitem>Copy a compressed kernel to, e.g.,
            /boot/test.gz on the ext2 partition that has the usual
            kernels</listitem>
            <listitem>Shut down the system</listitem>
            <listitem>At the console, type: 
            <programlisting>  # bfd /boot/test.gz</programlisting>
            </listitem>
          </itemizedlist>
        </para>
        <para>Note that the firmware has a <ulink url="#kernel">size
        restriction</ulink> when loading a kernel directly, so it's strongly
        recommended that you use the bootloader.</para>
      </sect3>
      <sect3 id="preparehd">
        <title>How do I prepare the harddisk for installing NetBSD?</title>
        <para>The firmware basically needs:</para>
        <itemizedlist>
          <listitem>An "FDISK" style partition table with a "Linux
          native" first partition is formatted as
          ext2fs.</listitem>
          <listitem>
          <filename>/boot/vmlinux.gz</filename>
          -- holds the gzipped kernel or boot loader (in Linux
          partition)</listitem>
          <listitem>
          <filename>/boot/vmlinux_RAQ.gz</filename>
          -- alternative name for RaQ 1</listitem>
          <listitem>
          <filename>/boot/vmlinux_raq-2800.gz</filename>
          -- alternative name for RaQ 2</listitem>
          <listitem>
          <filename>/usr/games/.doug</filename>
          -- optional backup kernel (in the same Linux
          partition)</listitem>
        </itemizedlist>
        <para>Everything else on the Linux filesystem can be
        trashed as it is totally unnecessary. You should be able to
        just fdisk/partition/newfs and copy a kernel onto the new
        filesystem. You shouldn't need to do a complete install on
        the disk.</para>
        <para>The disk that comes in the Raq2 has four
        partitions:</para>
        <para>
          <orderedlist>
            <listitem>Linux root (/): Recognizes as <filename>
            /dev/wd0e</filename> when there's no NetBSD disklabel on
            the disk, e.g., when doing a netboot. This partition has
            the compressed kernel or boot loader held at
            <filename>/boot/vmlinux.gz</filename>.</listitem>
            <listitem>Linux swap: This can be used later to swap
            into when NetBSD is installed; saves setting up a
            NetBSD swap partition. Identifies as
            <filename>/dev/wd0f</filename>.</listitem>
            <listitem>Linux /var: This 200MB partition has some
            data on it that you may want to leave in case you need to
            go back to Linux. Identifies as
            <filename>/dev/wd0g</filename>.</listitem>
            <listitem>Linux /home: This &gt;3GB partition has very
            little data on and can be copied over to the Linux <filename>
            /var</filename> partition so that you can use this partition
            as NetBSD's system disk. Identified as /dev/wd0h by default,
            installation steps below.</listitem>
          </orderedlist>
        </para>
        <para>All the Linux partitions have ext2 filesystems, and
        they can be checked (if needed) and mounted from NetBSD
        with:</para>
<programlisting>
  # fsck -t ext2fs /dev/wd0e
  # fsck -t ext2fs /dev/wd0g
  # fsck -t ext2fs /dev/wd0h
  # mount -t ext2fs /dev/wd0e /mnt
  # mount -t ext2fs /dev/wd0g /mnt/var
  # mount -t ext2fs /dev/wd0h /mnt/home
</programlisting>
        <para>Before installing NetBSD, it is recommended to back
        up the data of the Linux /home partition to the Linux /var
        partition. Then, use NetBSD's
        <quote><command>fdisk -u</command></quote>
        command to change the partition ID from 131 (Linux
        userland) to 169 (NetBSD). Following a reboot to get the
        new partition data, a disklabel can be written:</para>
<programlisting>
  # disklabel wd0 >x
  # disklabel -r -R wd0 x
</programlisting>
        <para>The disklabel now needs a NetBSD root partition
        (wd0a), and we use the old Linux home partition (wd0h) for
        that. Just change the "h:" in "disklabel -e wd0" to "a:",
        the filesystem type to 4.2BSD, and you're set. Next, create
        a filesystem and mount it:</para>
<programlisting>
  # newfs /dev/wd0a
  # mount /dev/wd0a /mnt
</programlisting>
        <para>After that, the NetBSD sets can be extracted.
        You need to extract at least etc, base and kern. comp
        is strongly recommended, and the others (text, games, man,
        xbase, ...) don't hurt. The sets are in the
        <filename>cobalt/binary/sets</filename> directory of the
        latest NetBSD release.</para>
<programlisting>
  # tar pzvxCf /mnt etc.tgz
  # tar pzvxCf /mnt base.tgz
  # tar pzvxCf /mnt kern.tgz
</programlisting>
        <para>After that, device nodes need to be created:</para>
<programlisting>
  # cd /mnt/dev
  # sh MAKEDEV all
</programlisting>
        <para>The final step is to ensure we can boot a NetBSD
        kernel with the bootloader. It's also recommended to create
        an entry in (<filename>/mnt</filename>)<filename>/etc/fstab</filename>
        to mount the Linux root partition:</para>
<programlisting>
  /dev/wd0e /altroot ext2fs rw 0 1
</programlisting>
        <para>Compress the boot loader extracted from base.tgz
        and put it on the Linux root partition.</para>
<programlisting>
  # mount /altroot
  # cd /altroot/boot
  # mv vmlinux.gz vmlinux.gz.linux
  # cp /usr/mdec/boot vmlinux
  # gzip -v9 vmlinux
</programlisting>
        <para>After these steps, the firmware should be able to
        find the kernel and boot it:</para>
<programlisting>
  # reboot
</programlisting>
        <para>What follows is that the system will boot and needs
        to get configured. If you have trouble mounting the root
        filesystem read/write, the command to get that is <quote>
        <command>mount -u /dev/wd0a /</command></quote>.
        Now set up <filename>/etc/rc.conf</filename> and enjoy!</para>
        <para>Sorry, there's no all-singing, all-dancing
        install-routine (yet).</para>
      </sect3>
      <sect3 id="qube2700serial">
        <title>Serial interface for the Qube2700</title>
        <para>The Qube2700 is shipped without any serial interface.
        It is however possible to construct one by following these
        instructions. Should you choose to do this we do, of course,
        not take any responsibility in the event that something goes wrong.
        </para>
        <para>This serial interface is, however, not a full I/O
        serial due to both hardware and software limitations. It
        can only be used while talking with the boot ROM or reading
        console, which can come in handy while debugging.</para>
        <para>In your Qube2700 you should find a print on the PCB
        as (or similar):</para>
        <para>
<programlisting>
        Cobalt Microserver, Inc.
        CPU Board 850-00101
</programlisting>
        </para>
        <para>You would then have a 18 or 20 pin header titled "SCC
        CON" adjacent to the AMD 28F040 chip. The pinout of the
        header is as follows:</para>
        <para>
<programlisting>
            memAD0  2    1   +5V
            memAD1  4    3   Dadr0
            memAD2  6    5   Dadr1
            memAD3  8    7   serialInt_low
            memAD4  10   9   serialClk
            memAD5  12   11  serialCs_low
            memAD6  14   13  tied to devWr_low
            memAD7  16   15  no-connect
         devRd_low  18   17  ground
         devWr_low  20   19  ground
</programlisting>
        </para>
        <para>The pin 20 and pin13 tie is because there are some
        systems with 18-pin headers, and some with 20-pin.</para>
        <para>The 
        <ulink url="files/serialbd5V.pdf">schematic</ulink>
        requires only a <ulink
        url="http://www.zilog.com/docs/serial/ps0117.pdf">Z85C30
        serial chip</ulink>, a DS14C239, and a few resistors and
        capacitors to build.</para>
        <para>This schematic uses 44-Pin PLCC package 85C30,
        but maybe it's easier to use 40-Pin DIP package to build
        the interface from scratch. You can also use other major
        RS232C serial line drivers like MAX232C or compatibles
        with some modification.</para>
      </sect3>
      <sect3 id="ram">
        <title>The system hangs at random times</title>
        <para>If you experience weird, random hangs when accessing
        the disk (e.g., via disklabel), when doing NFS writes etc.,
        have a look at the order of memory modules in your machine!
        For example, if you have a big and a small module, and you put
        them in the wrong order, the "BIOS" will complain about
        that:</para>
<programlisting>
 5.Bank 0:.................................16M
 6.Bank 1:.................................0M
 7.Bank 2:.................................16M
 8.Bank 3:...............................**Simm0 must be >= Simm1**
</programlisting>
        <para>The above example is for a 16MB module in the slot
        near the case, and a 32MB module in the other slot. With
        such a config, you can experience all sort of weird
        problems. If you exchange them, all will be good. The boot
        message should be:</para>
<programlisting>
 5.Bank 0:.................................16M
 6.Bank 1:.................................16M
 7.Bank 2:.................................16M
 8.Bank 3:.................................0M
</programlisting>
      </sect3>
      <sect3 id="install-withoutcable">
        <title>How do I install without a serial cable?</title>
        <para>The easiest way is to use the <ulink url="restorecd-howto.html">
        Restore CD</ulink>. If you don't have an i386 server or would like
        to install manually, use the following procedure.</para>
        <para>Prepare netboot host: 
        <orderedlist>
          <listitem>
            <command>mkdir /nfsroot</command>
          </listitem>
          <listitem>
            <command>ftp ftp.NetBSD.org/.../{base.tgz, etc.tgz,
            kern-GENERIC.tgz}</command>
          </listitem>
          <listitem>
            <command>tar zxpf base.tgz;
            tar zxpf etc.tgz;
            tar zxpf kern-GENERIC.tgz</command>
          </listitem>
          <listitem>
            <command>cd dev; MAKEDEV all</command>
          </listitem>
          <listitem>
          <command>cd etc</command>
          ; edit 
          <filename>rc.conf</filename>
          to enable multiuser boots, inetd, telnet. Add <quote><code>secure</code></quote>
          lines to 
          <filename>/etc/ttys</filename>.
          Edit 
          <filename>fstab</filename>
          to: 
<programlisting>
10.10.10.10:/nfsroot    /       nfs  rw 0 0
</programlisting>
          </listitem>
          <listitem>
            <command>mkdir /nfsroot/boot</command>
          </listitem>
          <listitem>copy a bootloader in <filename>usr/mdec</filename>
          directory</listitem>
          <listitem><command>gzip</command> and rename the bootloader properly.
          For Qube2: 
          <filename>vmlinux_raq-2800.gz</filename>
          </listitem>
          <listitem>edit 
          <filename>/etc/dhcpd.conf</filename>.
          You'll need at least the following: 
<programlisting>
subnet 10.10.10.0 netmask 255.255.255.0 {
	range 10.10.10.125 10.10.10.135;
	option routers 10.10.10.10;
}
host qube {
	hardware ethernet 0:10:e0:xx:yy:zz;
	fixed-address 10.10.10.130;
	filename "/vmlinux.gz";
	option root-path "/nfsroot";
}
</programlisting>
          </listitem>
          <listitem>edit 
          <filename>/etc/exports</filename>
          and add: 
<programlisting>
/nfsroot -maproot=root 10.10.10.130
</programlisting>
          </listitem>
          <listitem>enable nfs and dhcpd on host server.</listitem>
        </orderedlist>
        </para>
        <para>Netboot the qube: 
        <orderedlist>
          <listitem>hold down the
          <ulink url="#buttons">two left-right arrow buttons</ulink>.
          </listitem>
          <listitem>hopefully, all has gone well and you should be
          able to bring it up and telnet in. Use tcpdump or 
          <filename role="pkg">net/wireshark</filename>
          to check.</listitem>
        </orderedlist>
        </para>
        <para>Do the actual install: 
        <orderedlist>
          <listitem>Run 
          <command>fdisk -u wd0</command>
          . Make a small Linux partition and a large NetBSD
          one.</listitem>
          <listitem>Run 
          <command>disklabel -i -I wd0</command>
          . Configure to suit.</listitem>
          <listitem>
            <command>newfs_ext2fs -O 0 /dev/wd0e</command>
          </listitem>
          <listitem>
          <command>newfs /dev/wd0a</command>
          and so on.</listitem>
          <listitem>
            <command>mount /dev/wd0a /mnt</command>
          </listitem>
          <listitem>cp or tar everything onto 
          <filename>/mnt</filename>
          </listitem>
          <listitem>
          <command>cd /mnt/etc</command>
          and edit files so that it doesn't try to netboot anymore.
          Change 
          <filename>fstab</filename>
          , set up 
          <code>ifconfig.*</code>
          files if needed.</listitem>
          <listitem>
            <command>umount /mnt; mount /dev/wd0e /mnt</command>
          </listitem>
          <listitem>
          <command>mkdir boot</command>
          .  Copy gzipped bootloader as 
          <filename>/boot/vmlinux.gz</filename>
          or whatever.</listitem>
          <listitem>
            <command>reboot</command>
          </listitem>
        </orderedlist>
        </para>
        <para>Everything should now come up. You have a NetBSD
        system installed on your qube/raq.</para>
        <para>Major gotchas: 
        <filename>/etc/ttys</filename>
        must have secure added. Enable telnet. Check various names
        of the kernels.</para>
      </sect3>
      <sect3 id="restore">
        <title>How do I create a Restore CD?</title>
        <para>Please see the
        <ulink url="restorecd-howto.html">Restore CD HOWTO</ulink>
        for detailed instructions on how to create your own Restore
        CD.</para>
      </sect3>
    </sect2>
    <sect2 id="other-sources">
      <title>Other sources of information</title>
      <sect3 id="diskless">
        <title>
          <ulink url="../../docs/network/netboot/">
          Diskless NetBSD HOW-TO</ulink>
        </title>
      </sect3>
      <sect3 id="serialport">
        <title>
          <ulink url="../../docs/Hardware/Misc/serial.html">
          NetBSD Serial Port Primer</ulink>
        </title>
      </sect3>
      <sect3 id="cobalt-users-group">
        <title>Homepage of the 
        <ulink url="http://cobaltqube.org/">Official Cobalt users
        group</ulink>
        </title>
      </sect3>
      <sect3 id="rushmere">
        <title>The TeamRushmere TeraQube2</title>
        <para>Step by Step instructions on turning the 
        <quote>Cobalt Qube2 into a really useful server</quote>
        : 
        <ulink url="http://www.teraqube.co.uk/" />.</para>
      </sect3>
      <sect3 id="sun-cobalt">
        <title>Resources from Sun Cobalt</title>
        <para>
          <itemizedlist>
            <listitem>
              <ulink url="ftp://ftp.cobalt.sun.com/pub/" />
            </listitem>
            <listitem>
              <ulink
              url="http://www.sun.com/hardware/serverappliances/documentation/discontinued.html">
              Sun Product Manuals</ulink>
            </listitem>
            <listitem>
              <ulink
              url="http://jp.sun.com/products/servers/serverappliances/technical/manual.html">
              Sun Product Manuals in Japanese</ulink>
            </listitem>
          </itemizedlist>
        </para>
      </sect3>
    </sect2>
    <parentsec url="./" text="NetBSD/cobalt Port Page" />
  </sect1>
</webpage>


