Installing NetBSD

*UPDATED 10/01/2007*: Seems someone had some trouble booting NetBSD 3.1 on his PMAX: It turns out that the CPUID of the R2000A reports as 0x0216. A normal R2000 reports as 0x2000 and a R3000 as 0x3000, resulting in a kernel that doesn't boot on the poor PMAX with "Unsupported CPU type" - it was odd that older kernels didn't care and reported that my DECstation had a R3000 despite it clearly having a R2000 in it - I didn't think much of it as they were instruction set compatible. Dennis Grevenstein rootcaused this issue and added a CPUID for the R2000A to NetBSD and reported it boots fine now. Unfortunately I don't have any spare HDDs to install a new NetBSD and glad I didn't overwrite my hdd before trying to install 3.1...
Keep in mind: not all DECstation 3100s are affected by this issue. I haven't had a chance to test it on mine, it's still running 1.6.2.

This is a work in progress and is incomplete:

Originally, you must start with existing system as there wasn't a way to boot NetBSD on a pmax without a helper machine or Ultrix. Floppies aren't standard and won't boot anyway, and nobody has a tk50 install working. You can use a NetBSD/i386 box, a working pmax machine (netbsd or ultrix), or some other machine.
The old 1.1 through 1.3 NetBSDs used a miniroot that needs to be dumped onto a disk partition to install.

However with NetBSD 1.4 and higher you should be able to boot from install images.

This is a summary of what I used from NetBSD's install notes

1. Boot system:
This is the hardest part. You want to get the machine up so you can complete the install. I didn't like netbooting but that's an option. I opted for getting the hard drive setup somehow.

In NetBSD 1.6.2 you can boot NetBSD via a cdrom. Download the cdrom iso and burn it to a cd-recordable. The CDROM image is less than 80MB so either a mini- or full sized cdrom will work. Business card CDs are too small.
After burning the CDROM, it's time to boot it. DECstations are very picky with cdrom drives, and you'll need to make sure the cdrom is set to 512-byte sectors. You may need to try multiple cdrom drives before finding one that works. I've found that my Pioneer DR-U24X CDROM reader works, but my Yamaha crw8424s (CDRW, 24x read/8x write/4x rewrite) does not.
Now get to the boot prompt: turn on the machine and insert the cdrom in the drive. Make sure you know what device number you set your cdrom as.
Watch the machine as it counts down.


At this point, it will try booting the old OS if you have it set in the nvram. I'm recalling this from memory so this might not be exactly what it says:
auto: rz(0,4,0)/vmunix ...

Quickly press ^C to abort out of the boot sequence, before it actually starts executing the kernel. If I remember correctly, Ultrix is like NetBSD will first print out the boot sector introduction text, and as it loads the kernel image it will print out the text, data, stack sizes and print out a little spinner until it loads the kernel. Abort the load before it starts printing out the text indicating the OS revision.
If you don't have the NVRAM set or it's forgotten its settings, you'll drop directly to the next session as if you pressed ^C.
You'll see
KN01 V7.0

At this point, you'll need to specify booting the NetBSD CDROM. Type:
boot -f rz(0,x,0)/install
where the x is the SCSI ID of your cdrom drive. It appears that it will automatically use the correct image even without the "/install" as said in the install notes, sometimes.
If all goes well, it will start running the installer program. The first prompt it will ask is console type, where you can just press <ENTER> to select rcons. You'll soon see the menu as you see on many other NetBSD installs. At this point you can follow NetBSD's instructions.

2. Next you'll need to partition disk using disklabel and setting up boot sector.
Most likely you'll be doing something like:
disklabel -W to enable writing
disklabel -e /dev/sdXc to actually partition
installboot /dev/rsdXc /usr/mdec/bootrz_ffs Install bootsector.

Make sure you make root at least 48MB or larger, 32MB is the absolute minimum if you dont intend to use anything other than the stock GENERIC kernel. Note: the rzboot and bootrz files are in the base.tgz archive in pmax/binary/sets/base.tgz, they're in ./usr/mdec/* . If you're lazy just make your sd0a disk the same as your sd0c disk size.

3. newfs /dev/sdXa your disks

4. untar files to disk

5. reboot

How to compile th kernel

0. Make sure you have gcc, binutils are installed. A base install should have all this already there.

1. download NetBSD-Current or other version.
One way is to use sup. You'll need a supfile to use sup which contains the data needed to retrieve the source code. Contents of a sample supfile which can be used to retrieve the source:

current release=ksrc-common hostbase=/ftp/pub \
        base=/usr prefix=/usr \
        backup use-rel-suffix
current release=ksrc-pmax hostbase=/ftp/pub \
        base=/usr prefix=/usr \
        backup use-rel-suffix
Then you can run
sup supfile to retrieve the code.

2. Configuring the kernel.
Obviously, make sure your system is set up properly before attempting this.

cd /usr/src/sys/arch/pmax/conf
config BASIC

The file GENERIC is the generic configuration file. You want to copy it to another file and start hacking at it. Likely you'll want to get rid of anything dealing with the DECstation 5000 as that hardware is not used on the 2100/3100.
The command 'config' will read your configuration file and set up a compile environment.

3. Compiletime

cd ../compile/BASIC
make depend; make

BASIC is the name you specified before. make depend builds the dependency tree for compilation files. make will actually compile and link the files together. After about 6 hours it will create a file "netbsd" which is your new kernel.

4. Installation

cp netbsd /
This will copy the new kernel to your root disk. Then if you have your boot sector installer working properly you'll be able to just specify
boot -f rz(0,x,0)/
at the boot prompt to use your new kernel.