Embedded Unix

There are basically two types of embedded systems one is likely to come across. Ones with x86 processors and those that use ARM. The x86 are not as plentiful and they cost more. Inside, they are mostly VIA chips though Intel Atom and some AMD low power are coming on. The majority are often found to be Marvell Orion based on the ARM instruction set.

I've worked with both, in the form of the Orion in the DNS-323 and in a Via C7-D in a Artigo A2000. The DNS-323 is neat and to be honest, was never designed to be a general purpose system. But the Via is significantly more usable comparable in power consumption, and significantly more powerful.

Many of the VIA boards ship with a Compact Flash adapter you can use for the system. However, these devices have a limited amount of reads and writes, so you want to take special steps, right? Well. yes and No. There are some steps that will optimize the environment. However, don't forget that dispute being called Compact Flash, this is a block device, not a flash device. Do not try to use the jffs2 file system or any of the utilities you would use for the Orion devices.

One Should;
  • Not use swap partition
  • use Ext2
  • Set the noatime option
  • Use selected ram disk
Your swap partition will get used to some extent, even when not strictly needed. You can optimize the swappiness somewhat but the simplest method is to not have any if you don't needed it. A good cut off is 512MB. Any less and you need a swap regardless. This is fairly controversial, but we are focused on embedded here.

Use of ext2 minimizes the writes to the device over ext3 and other journaling systems. If you have any exposure to unexpected power outages though, consider ext3. It's theoretically shorter lifespan for a proven data protection.

Setting the noatime options stops the system from writing to disk to update the last accessed attribute every time it reads a file. This significantly cuts down on writes. Do this by changing your fstab file as so

    UUID=8037fd09-ea0d-4c28-a348-1fbdf9fb0b92 / ext3 
relatime,noatime,errors=remount-ro 0 1

Add the following lines to your fstab. They move most temporary files to a ram disk.Identify others that you may need and adjust logrotate to move files from ram to disk at your taste. (and adjust for your flavor of linux)

tmpfs /tmp tmpfs defaults,noatime 0 0
tmpfs /var/run tmpfs defaults,noatime 0 0
tmpfs /var/log tmpfs defaults,noatime 0 0
tmpfs /var/lock tmpfs defaults,noatime 0 0
tmpfs /var/tmp tmpfs defaults,noatime 0 0
tmpfs /var/lib/dhcp3 tmpfs defaults,noatime 0 0


  • Marvell Orion based NASes will generally produce throughput in the mid-to-high teen MB/s
  • NASes using the VIA C7, Intel Atom or AMD Geode will provide read/write performance in the 30 - 40 MB/s range
  • When you move up to NASes based on Intel Celeron or Dual-Core or Freescale MPC854XE, you can see speeds of at least 50 MB/s and more like 70 MB/s.

I am going to use JFFS2 on top of my USB stick/CF card/etc, is it OK?

USB sticks, CompactFlash cards and other removable flash media are not MTD devices. They are block devices. They do contain flash chip inside, but they also contain some translation layer above which emulates block device. This translation layer is implemented in hardware. So for outside world these devices look exactly as hard drives, not like MTD devices.