Introduction
============
This document describes in depth how to prepare your NH-230/231 NAS for
installing NetBSD/sandpoint. Models based on the NH-230 have an ITE PATA
controller while those based on the NH-231 have a SiliconImage SataLink
SATA controller. The following models are known to be compatible:
- Allnet 6250 (PATA)
- Allnet 6260 (SATA)
- Encore ENNHD-1000 (PATA)
- Fujitsu-Siemens AMS150 (SATA)
- Fujitsu-Siemens SBLAN2 (SATA)
- Lindy NAS Personal Server Premium, IDE (PATA)
- Lindy NAS Personal Server Premium, SATA (SATA)
- Longshine LCS-8311 (SATA)
- Netronix NH-230 (PATA)
- Netronix NH-231 (SATA)
- Planex NAS-01G (PATA)
- SinanPower GigaBit LAN NAS-349 (SATA)
- Vibe NS-349-S (SATA)
The hardware shown in these instructions is an Allnet 6250.
Accessing the serial interface
==============================
We need a serial console to get access to the firmware. Therefore you
have to open the case and connect a serial adapter, which converts the
NH-230/231 TTL levels to RS232 levels. You will also have to make a plug
for the 4-pin serial header on the board.
Locate the serial port
----------------------
Look out for a 4-pin header, which is labeled `J6` on an Allnet 6250
board.

Pin number

Function

1

3.3V

2

TXD

3

RXD

4

GND

Connect a serial terminal via a converter
-----------------------------------------
The serial port on the NH-230/231 compatibles is using 3.3V TTL levels,
which have to be converted into regular RS232 levels by a level shifter
circuit. Instructions how to build such a circuit yourself can be found
here:
- [Serial adapter for 3.3V TTL](http://www.NetBSD.org/ports/sandpoint/ttl2rs232.html)
Make sure that the layout of the connector fits to the pinout of the
boards serial header, as shown above.
Another option is to buy such a converter. There are solutions for a
standard RS232 interface and for an USB interface. Look out for:
- RS232 level shifter / breakout board (MAX3232 based)
- USB to TLL serial level shifter / breakout board (FT232 based)
Now you can connect with any terminal program to the NH-230/231 serial
console. The easiest approach may be to use NetBSD's `tip(1)` command to
make a direct console connection at 9600bps.
# tip console
Note that when using a serial connection via USB you may have to make an
entry for `/dev/ttyU0` in `/etc/remote`.
First time installation
=======================
The altboot bootloader
----------------------
The `altboot(8)` utility functions as a bridge between the PPCBoot
firmware and the NetBSD kernel startup environment. NAS firmware often
provides no means to boot a kernel from disk or from the network and
doesn't initialize all hardware correctly. We will also use it to pass a
bootinfo list to the kernel.
The `altboot` boot loader has to be loaded and started using the
NH-230/231 firmware, which is `PPCBoot 2.0.0-A9`.
PPCBoot 2.0.0-A9 (Feb 13 2006 - 14:56:11)
CPU: MPC8241 Revision 1.4 at 266.666 MHz: 16 kB I-Cache 16 kB D-Cache
Board: Sandpoint 8241 Unity ##Test not implemented yet##
DRAM: 64 MB
FLASH: Manufacturer code: 0xEC, Device code: 0xA2 : 4 MB
In: serial
Out: serial
Err: serial
EPIC: reset is in process ....doneNet:
RTL8169S driver v1.5-A4 03-15-2005
RTL8169#0
Press space to abort autoboot in 3 second
The functionality of this NH-230/231 PPCBoot version is restricted.
Probably to keep it small and to save space for a Linux kernel and
ramdisk in the 4MB Flash, but also to keep the user from hacking it. It
only allows to overwrite four predefined regions of the flash with
special **load** commands, and the lack of a **cp** command leaves us with
the only option to boot `altboot(8)` as a Linux kernel image through
**bootm**.
Getting altboot into RAM
------------------------
The `altboot` boot loader has to be loaded and started using PPCBoot.
Usually there are three ways to invoke it:
- **loadb** to load a binary file via serial line in kermit mode
- **tftpboot** to load a binary file over the network with TFTP protocol
- start it from the flash memory
The last option is prefered once the installation is completed, but
obviously it is not possible for the first time boot. Fortunately
PPCBoot has set up the network interface, which we can use after
configuring the `ipaddr` and `serverip` environment variables:

Boot the INSTALL kernel with altboot
------------------------------------
Now you can use `altboot` to launch the `netbsd-INSTALL` kernel for
installing NetBSD. You may choose to load it with TFTP or from NFS. For TFTP
you have to enable `tftpd(8)` in `/etc/inetd.conf`, and for NFS there is
a documentation at [The Network File
System](http://www.NetBSD.org/docs/guide/en/chap-net-services.html#chap-net-services-nfs).
But in both cases you have to set up a DHCP server, which is explained
in the [DHCP Howto](http://www.NetBSD.org/docs/network/dhcp.html). An
appropriate `dhcpd.conf` entry could look like this:
host nh-nas {
hardware ethernet 00:08:54:xx:xx:xx;
fixed-address 192.168.0.107;
next-server 192.168.0.5;
option root-path "/export/nh-nas/root";
}
The `root-path` option is only needed when using NFS and should match
your exported NFS directory. Uncompress `netbsd-INSTALL.gz` from the
NetBSD/sandpoint distribution and copy it into the NFS or TFTP directory.
Then start the DHCP, NFS or TFTP server and boot the installation kernel
from the firmware either with

Additionally you may think about replacing the Linux RAM disk image at
the second address (`0xfff20000` in the example above) by an empty
PPCBoot image, like [this](http://www.NetBSD.org/~phx/Sandpoint/dummy.img.gz)
one (do not forget to uncompress it with `gunzip(1)`). Or use **mkubootimage**
to make your own dummy. Write it to flash as shown below. This will speed up
the boot process, but is not really required.