Smallest embedded linux distro?

I'd say you're dreaming. The main problem will be the limited RAM.

In 2004, Eric Beiderman managed to get a kernel booting with 2.5MB of RAM, with a lot of functionality removed.

However, that was on x86, and you're talking about ARM. So I tried to build the smallest possible ARM kernel, for the 'versatile' platform (one of the simplest). I turned off all configurable options, including the ones that you're looking for (USB, WiFi, SPI, I2C), to see how small it would get. Now, I'm just referring to the kernel here, and this does not include any userspace components.

The good news: it will fit in your flash. The resulting zImage is 383204 bytes.

The bad news: with 256kB of RAM, it won't be able to boot:

$ size obj/vmlinux
  text     data     bss     dec     hex filename
734580    51360   14944  800884   c3874 obj/vmlinux

The .text segment is bigger than your available RAM, so the kernel can't decompress, let alone allocate memory to boot, let alone run anything useful.

One workaround would be to use the execute-in-place support (CONFIG_XIP), if your system supports that (ie, it can fetch instructions directly from Flash). However, that means your kernel needs to fit uncompressed in flash, and 734kB > 700kB. Also, the .data and .bss sections total 66kB, leaving abut 190kB for everything else (ie, all dynamically-allocated data structures in the kernel).

That's just the kernel. Without the drivers you need, or any userspace.

So, yes, you're going to need a bit more RAM.


IMO, you're dreaming. Especially with USB, networking and 802.11/wifi. I just don't think you can do that and M3 is really a stretch.

OpenWRT is one of the smallest and most embeddable Linux distro I know of for networking and it's hard to get that under 2MB, esp with Wifi.

Try looking into higher-end ARM chips if that's what you really want or go with the Broadcom or Atheros SoC's that are currently common in routers.


Do you have MMU on the processor? If you don't you might want to look at: http://www.uclinux.org/ that should give you much smaller kernel size than mentioned. It works for some CortexM3 Atmel chips so it might work for yours. I haven't used it so this is only speculative. Doh, I just saw that question had been updated - well if you don't have MMU (which you probably don't) you can't use "normal" kernel and you would need to use ucLinux.