freedom's just another word for nothing left to lose

Debian on the Freecom FSG-3

Here I will document my progress in getting Debian run nativly on the FSG-3. That is, you boot with debian-installer, you install Debian, you boot Debian.

Time will tell :-)

Some general information on redboot, mtd and tinkering with embedded hardware

The following are some random notes, I took, while all of this was explained to me. If you find mistakes or have other suggestions for improvals (or good links), please contact me!

mtd = memory technology device, name of the kernel driver = also known as flash!

mtd-utils = userland tools

mtd provides a character device and block device interface at the same time, eg. erase (from mtd-utils) works on the character device (like a serial device), while mount works on the block device (just like with hard drives).

Using the CPUs JTAG interface it's possible, among other use cases for JTAG, to directly write the flash. This makes it possible to reinstall redboot (or any other bootloader) in case the device was "bricked".

Installing redboot means writing it to /dev/mtd0. In general you should never overwrite /dev/mtd0 (well, unless you want to use JTAG to fix it...). And in the case of redboot, you should also not overwrite /dev/mtd(N) (the last partition), as it contains the FIS (Flash Image System)directory, which is needed by redboot.

/dev/mtd(N-1) (the last but one partition) in the case of redboot contains the redboot configuration. If you delete it, you should have a serial connection to your box, as you can only change the redboot configuration from within redboot. (You can dd configurations partitions from within linux, but it must be a configuration generated on the same type of device.)

Most arm devices can either run big or little endian. Which is run, is decided by the kernel: if the kernel is big endian, the system will be big endian. Same for a little endian kernel :)

Adding a serial console

This picture explains the < link>connectors for the serial console and if you click on the picture below, it will take you to some photos taken when adding a serial console to my FSG-3.

After powering on the device, you should see the redboot prompt immediatly. If you don't something is wrong with your cable or serial settings. First guess is to exchange RX and TX :-) (The white cable is ground.)

A link to the usb/rs232 converter is missing here atm...

Having fun with redboot

To enter the redboot shell, press ctrl-c in the first 4 seconds. (Other delays can be configured.)

The recovery process (with pressing reset and loading a zImage from the net) uses the normal redboot bootloader, but uses a different configuration for redboot than normally (it is not stored in /dev/mtdN-1 but elsewhere).

Keep in mind, that if you enable the debug mode in redboot, booting and everything will be slower, as it's send to the serial console all the time, even long after you finished debugging :-)

redboot can either boot from flash or from the network. Booting a kernel from harddrive is not supported.

You need to reset the box after you changed IP addresses in the redboot configuration, to actually makes those changes.

Redboot commands

  • help
  • help fis
  • fis
  • fconfig -l -n
  • ip-address # changes the ip address temporarily
  • fconfig -i # danger: delete all redboot configuration
  • fconfig -n # edit configuration (don't forget to reset after changing the network settings)
  • fis list # list partitions
  • load # load a kernel, see help load
  • fis create # writes a kernel to flash
  • exec # boots a kernel (from flash)
  • go # boots a kernel (from the network)
  • ping # :-)