The Ericsson W25 is running an embebbed linux.
When you power on your device first the bootloader is started. The bootloader is responsible for loading in the complete operating system and start it up. In the Ericsson W25 there is a RedBoot bootloader, which has plenty of features. It is capable of booting from network, from serial devices, it has a telnet interface etc., but in our case it just selects the propper linux kernel and the propper root file system and starts up the linux operating system.
All the software to be loaded is stored in the built in ROM, in 9 partitons:
0x00000000-0x00080000 : "RedBoot"
0x00080000-0x001c0000 : "kernel_A"
0x001c0000-0x007a0000 : "rootfs_A"
0x007a0000-0x008e0000 : "kernel_B"
0x008e0000-0x00ec0000 : "rootfs_B"
0x00ec0000-0x00fa0000 : "rwfs"
0x00fa0000-0x00fe0000 : "test"
0x00fe0000-0x00fff000 : "FIS directory"
0x00fff000-0x01000000 : "RedBoot config"
As you can see the first partitition is the boatloader itself, while the last partition is the configuration for the bootloader. The "FIS directory" is the "Flash Image System directory" which actually holds the addresses of the above listed partitions.
Partition "test" is probably not used.
Partition "rwfs" is the partition which contains the writable parameters of the router. It countains a jffs2 type filesystem.
Partitions 1-4 hold two versions of the kernel and the root file system. This is a good way of making the device more secure, if a firmware update does not sucseed, there is a copy of the earlier version and the device can switch back to the previous version. Probably there are some commands in the device, where you can switch between these partitions, but so far I have not found them.
The used linux is a MontaVista linux, which is a commercial distribution. The main point of using it, that it gives you a complete development environment with support and instead of trying to find the best components to use, you can develop your device very quickly. As in most embebbed linuxes, most of the commands are implemented in Busybox. Busybox is used to reduce the space used by small command files, instead there is one big executable, which is including all the small unix utility commands. The commands can be executed by shortcuts pointing to the busibox executable.
The management of the wireless router is done by Tail-f Systems ConfD product. This utility makes it possible to handle the different configuration interface identically, and it has ready tools to implement a commd line interface, a web interface and SNMP interface. The command line interface is called cf and when called without parameters it gives a help about the available commands.
After booting up, the root file system will be the selected partition from the flash (3 or 5) which has a squashfs filesystem. This contains all the non changing files. The 6 th flash partition is mounted to /rw, here are stored the parameters which are changing, but have to be preserved between the restarts of the router. There is a RAM based filesystem mounted on /var, which is populated during the init procedure from /etc/varfs.tar and it is a tempfs type filesystem.
To be able to use standard tools, the important configuration files from the /etc directory are symlinked to the /rw/etc and when they are changed these chages are kept peristent in the rw filesystem. The advantage of this solution is that it is very simple, but if you want to change a parameter, which it is not prepared for it (e.g. timezone), you can not change it whithout changing the entire read only root filesystem. A better solution would be to use a filesystem like unionfs which can combine a read only and a read write filesystem and store the changes in the writable filesystem.
This is enough from the theory, in the next post I will write about how to make your own init script to start your very own programs after rebooting.