What you'll need:
* A Netcomm NB5PLUS4W router (well duh)
* A computer
* An ethernet cable
First, a few things to understand about the Netcomm NB5PLUS4W.
The processor is a Texas Instruments AR7WRD SoC processor - a MIPS 4KEc @ approx 212MHz (with a 125MHz system bus). It has 16mb of RAM and 4mb of flash memory. The router boots using the PSPBoot bootloader (similar to the ADAM2 bootloader, and even has the same username and password for the bootloader). The stock firmware runs off a modified version of MontaVista Linux.
The flash memory is segmented into 5 MTD groupings - mtd0 contains the readonly filesystem that the kernel mounts as root, mtd1 contains the actual kernel image. mtd2 contains the PSPBoot binary, with mtd3 being used as NVRAM for the PSPBoot's environment and configuration. mtd4 encompasses mtd0 and mtd1 - this is the group that the firmware image must be written to so that the kernel can be booted and the root filesystem mounted. mtd5 is usually mapped to an empty portion at the end of mtd0/mtd4 and can be formatted with minixfs to be used as a writeable storage partition. At most you could get around 1400kb in Kamikaze 8.09.1 but this is clearly better than the alternative.
In any case, since the base of the stock firmware is Linux, you can get OpenWrt running on this router with a little effort (and some maths too).
First things first, ssh into your router and type
cat /proc/ticfg/env | grep '^mtd.'
# cat /proc/ticfg/env | grep '^mtd.'
mtd2 0x90000000,0x90010000
mtd3 0x90010000,0x90020000
mtd5 0x903f0000,0x90400000
mtd4 0x90020000,0x90400000
mtd1 0x90020090,0x9009f000
mtd0 0x9009f000,0x90400000
A quick note on the numbers here: the 9 (binary sequence 1001) indicates that this is an address to the flash memory, the remaining numbers point to a location in the flash memory - with the maximum for this router being 0400000 (which equates to 4MB of flash).
Now, first things first - let's find out where the boundary between the kernel and the filesystem lies. Get a hex editor (if you're on a Linux system, hexer is a good one). Do a search for 'hsqs' and note the location of this string - this is where the root filesystem begins. In my example (Kamikaze 8.09.1), this occurred at byte 000d0000 - or 851,968 bytes. Note the start of the mtd1 block - this will have to be altered to reflect the beginning of the image - otherwise 144 bytes won't get accessed and the router won't boot.
For the end of the mtd1 block, you'll have to add the address to the beginning of the root filesystem. If you're in Windows, the trusty Calculator will help - set it to scientific mode and choose Hex (for hexadecimal). In this example, add d0000 to 90020000, which should result in 900f0000. This, your address range for mtd1 will be 0x90020000,0x900f0000, and mtd0 will be 0x900f0000,0x90400000 (because the root filesystem begins at 900f0000 and ends at the end of the flash memory, which is 90400000).
This will give you the configuration of mtd0, mtd1, mtd4 and mtd5 as follows
mtd0 0x900f0000,0x90400000
mtd1 0x90020000,0x900f0000
Keep a note of these - you will need to later.
The next step is to prepare your router for the upload. Switch off your router, plug an Ethernet cable into it, then plug the other end into your computer. Set a static IP address on your computer (choose address 192.168.1.8, subnet address 255.255.255.0). Start up PCTool, then turn the router on. Wait for Windows to tell you that the Local Area Connection has been connected, then click "Retrieve/Assign IP Address". You have a 2-3 second window to do this in, so you may need a few tries. Once you are connected, click "Close", go to Start -> Run, then type ftp 192.168.1.1. The username and password are both adam2.
Copy and paste the following into the FTP session:
quote SETENV mtd0,0x900f0000,0x90400000
quote SETENV mtd1,0x90020000,0x900f0000
quote MEDIA FLSH
binary
debug
hash
put "openwrt-ar7-squashfs.bin" "c mtd4"
quote REBOOT
quit
And that's it. In a couple of minutes you'll be able to telnet in and set the password.
The only lingering issue is that the onboard wireless doesn't get picked up. If anybody knows how to get the wireless working, I'm open to suggestions. :-)
(Last edited by thirdwheel on 27 Aug 2009, 06:29)