Back

 Industry News Details

 
Tips and tools to deploy Linux for IoT devices Posted on : Apr 03 - 2017

As IoT adoption grows, more IT teams will consider running Linux for IoT devices. Learn the key steps and components involved, including the cross compiler toolchain.

As the internet of things market thrives, it's important to consider your options for working with internet of things devices. One option is to use a Linux OS -- but first, be aware of the differences between using Linux for the internet of things and using it for a server or desktop.

With the internet of things (IoT), you'll deal with specific devices that occasionally contain specific hardware components. Such devices require a highly-tuned version of Linux that you must set up manually, rather than a generic Linux distribution.

To get Linux for IoT devices, you'll need a development workstation. This is the computer you'll connect to the IoT device -- typically with a USB cable -- and from there, use to build the entire setup to then push to the device. There are no configuration files you can tune later on -- you'll need to do it all from the development PC and make sure you do it the right way.

Cross compiler tool set

One of the most important components when using Linux for IoT is the cross compiler tool set. This is the C compiler, together with the related utilities you'll need to build the boot loader, the kernel and the C library. It also includes the applications you will want your IoT device to offer, which will differ depending on its use. The cross compiler doesn't just compile source code to run on the local computer, but also allows you to compile code to run on the IoT device.

After you create the cross compiler toolchain, upload the different components of the IoT Linux operating system, starting with the boot loader. Since this component needs to integrate tightly with Linux, it often consists of different components that are written to different parts of the IoT device. While the device boots, a RomBOOT program is the first component that loads, followed by a bootstrap program, followed by the actual boot loader U-Boot. This is the component that loads the actual Linux kernel.

Compile the kernel

While desktop and server Linux systems use large modular kernels, you'll need to create a tailor-made kernel for IoT devices that uses minimal hardware resources in the most efficient way. That means you'll need to carefully configure and compile the kernel before you upload it to the device.

The next step is to upload the shell environment. On regular Linux OSes, this shell environment addresses many external commands, but on embedded Linux, you'll need a minimal shell. Busybox, the most common shell environment, contains minimal versions of all common Linux programs in the shell program itself. Once all of these are in place, you can address the root file system. This won't be a regular Linux file system, but a file system that is optimized to work with the flash media on the IoT device.

Managing IoT

Once you create the Linux distribution itself, manage and upload it to the IoT device. This requires specialized management software -- currently Yocto is one of the leading products. Yocto makes it easy to orchestrate embedded Linux for IoT among multiple devices and deploy configurations to them. Source