view · edit · print · history

This description assumes that you compile APEX on a PC; you'll need a standard cross-compilation environment (gcc, binutils etc). It is also possible to compile it natively on the NSLU2; that may be simpler but is not described here.

Download, unpack.

 $ wget ftp://ftp.buici.com/pub/apex/apex-1.4.7.tar.gz
 $ tar xzf apex-1.4.7.tar.gz
 $ cd apex-1.4.7

APEX uses something like the Linux kernel configuration system. This copies the default NSLU2 config to ./.config.

 $ make debian-nslu2-arm_config

Now make the necessary changes:

 $ make menuconfig
  • change default kernel command line as required

Build. Not sure if ARCH=arm is needed.

 $ make ARCH=arm CROSS_COMPILE=arm-linux-gnu-

Now swap the endianness of the binary file. Endianness is complex in the NSLU2 boot process!

 $ devio '<<apex.bin' >apex_swapped.bin 'xp $$,4'

We need a prepend a 16-byte header indicating the length of the binary:

 $ ls -l apex_swapped.bin 
 -rw-r--r-- 1 phil staff 41536 2006-11-25 22:50 apex_swapped.bin

41536 dec = A240 hex

 $ printf '\x00\x00\xA2\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' > a240hdr.bin
 $ cat a240hdr.bin apex_swapped.bin > new_mtd2.bin

For later Apex, it's best to pad with 0xFF at the end so that the apex environment can be changed. An alternative to the steps from devio to here is to use the Python script http://tech.groups.yahoo.com/group/nslu2-linux/files/Custom%20Executables/pad.py which will swap the endianness, prepend the header and pad it with 0xFF. This script can be run on the PC or on the Slug:

 $ pad.py apex.bin new_mtd2.bin

Copy this to the NSLU2:

 $ scp new_mtd2.bin slug:/tmp

On the NSLU2 below here

APEX is in flash block 2 - look in /proc/mtd

Sanity check

 $ od -x /tmp/new_mtd2.bin
 $ od -x /dev/mtdblock2

Do the first and last bits look vaguely similar?

Now program it into the flash

 # cat /tmp/new_mtd2.bin > /dev/mtdblock2


 # cmp /dev/mtdblock2 /tmp/new_mtd2.bin

Should EOF on /tmp/new_mtd2.bin, since it doesn't occupy the whole region

Now reboot, and see if it works.

can confirm this works... the new apex loader can also be flashed from Redboot if needed.

i am offering a pre-built padded but no env set apex.flash ( 131072 bytes ) ready for a Debian ( Little Endian ) on my website from my slug (http://gt-four.bounceme.net/files/apex.flash(approve sites)).

this as mentioned above can be flashed from the NSLU2 itself or from Redboot. its version 1.5.6, ready for anyone with a FatSlug.

To confirm that the additional RAM is working properly please run:

 fatslug:~# memtest all

This will not work with a 128MB Slug since there is still Bug 7760 "Page Allocation Failure on ixp4xx (nslu2) with 128MB RAM"

Details: http://bugzilla.kernel.org/show_bug.cgi?id=7760

Please check and report otherwise! (btw with 64MB enabled memtest works fine.)

view · edit · print · history · Last edited by Darryl Piper.
Based on work by fcarolo, caiacoa, Darryl Piper, Phil Endecott, Steve G, and dumfrac.
Originally by dumfrac.
Page last modified on January 22, 2010, at 12:47 AM