14th June 2017
This tier 1 customer required a fully functional Linux-based application suite, featuring dual redundant software banks, to be implemented for a small-footprint device with only 8MB of flash memory on board.
In the fast-paced device market, Linux has come to represent an excellent compromise between stability, performance, and development and deployment costs.
In one recent case, one of Civica’s customers required a fully functional Linux-based application suite, featuring dual redundant software banks, to be implemented for a small-footprint device with only 8MB of flash memory on board.
Bootloader and two copies of the software to fit within 8MB of flash. Two copies of the software are required so that, in the event of corruption of one copy, the system can still boot the standby copy. It is a common misconception that Linux has an unreasonably large footprint. We made it our goal to prove that a working Linux system and applications could be fitted into a small space. Linux and open-source based framework throughout, to minimize costs. Note that the Linux kernel, by itself, does not provide a useable user environment; a utility kit is required to complement the kernel and provide a user prompt/login services/etc.
The final software release was delivered as a single 3.1MB image, exceeding requirements by 112%. This permitted 400K of free flash space to permit future enhancements.
- Allocation of budgeted of space - The initial flash layout was budgeted to permit 0.5MB of space for the bootloader, 0.5MB of space for any persistent variable data, and the remaining 7MB for the software. This permitted 3.5MB for each software bank.
- Compressed self-contained software image - The industry-standard open-source bootloader, u-boot, was chosen for the project. U-boot is highly stable and customizable, and enjoys the active support of the open-source community. To pack the Linux kernel, toolkit, and application software into 3.5MB, the decision was taken to modify both the kernel and the bootloader to support SquashFS, a compressed filesystem whose contents can be decompressed and read on-the-fly.
- SquashFS software bank - The software bank would consist of a SquashFS image containing all of the components. This image would be mounted by the bootloader and the kernel booted from it. The kernel would then, in turn, mount the same SquashFS image and load the application software from it.
- Provision of a standalone command-line environment - To minimize space usage, the busybox “swiss army knife” toolchain was used. Combined with the Linux kernel, busybox provides a complete networked Linux environment upon which applications and services may be built.