It is not practical to write all of the machine-dependent code from scratch. You should use as a base the NetBSD port for the machine most similar to the target machine. Ideally, there should already be a port to the CPU of the target machine; this will save you the trouble of rewriting all of the machine-language portion of the machine-dependent code. The easiest CPU to port to is the Motorola 68000-series, starting with the 68020. There are several ports already for this chip ( e.g., Macintosh, Sun 3, Amiga, and HP 300), and a good bit of code is already shared among them. Other supported CPUs are the Intel i386, the MIPS R3000 (whose port name is ``PMAX''), and the Sun Sparc chip. Send e-mail to core@NetBSD.ORG to get an up-to-date list of working and in-progress ports.
Choose a name of your port that describes as specifically as possible the machine that the port will run on. For example, our Macintosh port was originally called ``Mac'', but was later renamed to ``Mac68k'' because the PowerPC chip was not supported. Make a copy of the /usr/src/sys/arch/ name sub-tree (where name is the name of the base port you choose), rename the subdirectories and files appropriately, and you are ready to start the port.