By replacing the Linux Kernel's TCP/IP stack with picoTCP, we aim to lower the threshold to use Linux on small embedded systems and bring it to the IoT world. In this case we ran it on a Cortex-M microcontroller with a few MBs of RAM and flash.
Using picoTCP inside the kernel results in a reduction of the kernel's size by over 300 kb, while still having all of the TCP/IP functionality an embedded system might need, and more.
The talk will start with a demo, then a motivition why we did this, and finally explaining how we did this.
picoTCP for Linux Kernel tinification
"Linux runs on everything from cellphones to supercomputers"; While this is true, in 2014 an average cellphone has around 2GB of memory, 16GB of flash and a quad-core CPU. The embedded systems we have in mind for the Internet of Things might be more in the region of a few megabytes of flash and ram.
The Linux kernel has been growing in size over the years; growing in features also. But a lot of the development has been focused on supporting more CPUβs, more memory, more high-end stuff to support supercomputer-like systems. The minimum possible kernel size has increased with almost every release.
An ongoing effort exists to try and tinify the Linux kernel, with these embedded systems in mind. There is the Tiny wiki1, LWN article on Kernel tinification2 and the LWN article on Networking on tiny machines3.
Being embedded system developers, getting inspired by these articles, and being the creators of picoTCP, we thought of pushing the tinification a step further: Replace the Kernelβs TCP/IP stack with picoTCP. picoTCP is a free TCP/IP stack designed for embedded systems.
In a typical ucLinux kernel the network functionality is over 500 kb; that can be 1/4th of the kernel!
The talk will start with a demo of picoTCP inside the Linux kernel, running on an STM32F4 Cortex-M4 microcontroller. Then, weβll show some figures on why this is important, and explain the steps taken to strip the default TCP/IP stack from the kernel and replace it with picoTCP; reducing the kernel size by over 300 kb.
References:
https://tiny.wiki.kernel.org/
http://lwn.net/Articles/608945/
http://lwn.net/Articles/597529/
uC Linux kernel size - nominal - = 2.1 MB
uC Linux kernel size - No Network Support - = 1.5 MB
uC Linux kernel size - No TCP, but drivers - = 1.67 MB (1,749,216 b)
uC Linux kernel size - PicoTCP (ipv4, dns client, arp, tcp, udp, icmp) - = 1,790,912 b (+ 41696 bytes = 40.7 kB)