Yocto Project: Build custom operating system for embedded devices

June 14, 2020

Lang: cs en de es

The electronics market is growing. Many companies are developing various projects with customized devices. These devices are called embedded hardware. Hardware performance has advanced and so many embedded solutions have powerful hardware in them. And due to all these reasons, many new devices are being developed for which companies need customized software and operating system. Nowadays everyone is opting for Linux and Yocto Project will enable them to prepare such a system efficiently. With Yocto Projket you can prepare your own distribution for your hardware.

Operating system in the device

Most electronic devices today are actually computers: cell phones, televisions, routers. Users may not know it, but all these devices typically run on GNU/Linux, which has become the standard for embedded hardware.
And because Linux is a very high quality system and a very customizable base, emerging companies and projects automatically use Linux. Now die-hard Windows proponents are switching to Linux. Even Microsoft itself supports Linux.

Companies and Development

So companies want to use GNU/Linux in their devices, following the example of others. Sometimes companies are inexperienced and so don't know how to do it, and so each company approaches the project in its own way.
Developing any software project is challenging, especially hardware projects. Old developers are often brought up on MS DOS by younger ones on Windows and Unix philosophy is unknown to them. Such developers struggle with Linux system preparation and find it difficult to navigate open-source project development. This is where the first problems arise from ignorance . Yet developing anything for Linux is significantly easier for the knowledgeable user.
The right approach is also important in the long run. A user who only knows the gold-plated Windows cage often works like an elephant in the china shop when developing Unix software.
It is then ideal for MSDOS and Windows experts to take at least a basic MSDOS and Windows Linux training. It is also a good idea to install GNU/Linux as the main operating system on your work computer. Because this also gives the programmer new knowledge and skills.
Or a company can recruit young developers for whom Linux is a completely natural thing.

Whatever kind of developers a company has, it's for these companies that Yocto Project, which allows them to prepare a customized system, and moreover a universal one, so that they can quickly prepare the system for other purposes or even other devices. For newer versions for different devices. The Yocto Project also streamlines the work through collaboration between developers, manufacturers and other contributors. All that is needed is to become familiar with the Yocto Project, the Unix philosophy and open-source.

Linux and embedded

I personally encountered embedded development for linux when I acquired a free smartphone OpenMoko Neo Freerunner. Back then, I first programmed in C language for ARM microprocessors. I successfully ported the communication libraries and made interfacing with peripherals with which I could then communicate with. So far, the manufacturer of the peripherals in question does not support Linux. But thanks to customer pressure and the work of the community, after ten years at least it shows how their devices can to connect to Linux as I once did connecting with RasberryPI.

In those days, the system image was prepared using tools/projects like openembedded, buildroot or LTIB. I've worked with all of these tools...
The big shift came when Linux created the HW (board) definition system and when the Yocto Project was created.
As a result, developers have less work to do to prepare the system for other HW, board, or modifying the system according to the customer's needs.

What is Yocto Project

The Yocto Project is an open-source collaborative project, aimed at developers of Linux embedded devices. Among other things, the Yocto Project uses OpenEmbedded, which uses the BitBake tool, to build complete Linux images. The BitBake and OpenEmbedded components are combined to create a reference build environment that is executable on the developer's machine.
With this environment, you can then use predefined definitions and customizations to create complete system for a specific embedded device including your applications.
Using the Yocto project, anyone can build their own Linux distribution to suit their hardware and specific needs. At the same time, the principles of Yocto development allow for repeatability of the process and ensure self-documentation project.

A common system has already been created by others before us, so the first sample preparation is very easy. There are ready-made definitions for compiling and integrating programs, so you just specify what you want to have in your system. The system can be in the form of a kernel and system image that uploads to flash memory. Programs are also compiled as packages, which can only be installed into the system later so there's no need to rebuild the whole system image and flash the device when you're just making a change user program.
Many platforms are predefined as well, and each new platform should be predefined by its manufacturer. Such a definition is called a Board Support Package (BSP).

Configure how to compile a system and individual programs and then build the system and packages from them is defined in files called recipes. These files are then used by the BitBake, which runs and manages the whole process.

Video Yocto Project

How does Yocto start?

How do you create your first system using Yocto is described in the English tutorial. For testing purposes, you can simply prepare a system for x86, which is then run using the QEMU emulator.

Briefly, the process of preparing and creating a custom system consists of the following steps:

  1. Downloading the Yocto project source data.
  2. Checking system requirements and installing the necessary GCC make tools etc.. You also need to have plenty of disk space to get everything done, because the source data is large and many, and more files will be created when compiling and building the system image.
  3. Configure what you want to compile in what version and for what platform.
  4. Compilation and build tools to compile and build programs and the target system. cross-compilation (=compiling on a different architecture than the target) is also supported. So you don't download any tool-chain (=tool to compile and build the system for the device), it's customized for you.
  5. Compilation of the kernel, tools and programs, build package and system, and build system image, that can be loaded onto the device.

Collaboration

The Yocto project allows you to work effectively within teams and companies. An individual does not have to create an already finished one. Yocto Project enables hardware manufacturers to deliver devices with Linux support and ready-to-run demos system. Which simplifies and speeds up the start of development. The system build process can be automated. Last but not least, a project developed using Yocto Project principles is self-documenting.

Links

Yocto Project
LTIB
OpenEmbedded
Buildroot
BitBake

Articles on a similar topic

VMware vs Proxmox: performance comparison
GitLab CI/CD: test automation and application deployment
Migrating VPS from VMware to Proxmox
VMware licensing change
Running Microsoft SQL Server on Linux
Backup: the Proxmox Backup Server
Linux as a router and firewall
How to upload a docker image to the Docker Registry
Linux: logical volume management
Linux Software RAID
Running a web application behind a proxy
Mailbox migration
Docker multistage build
Backing up your data by turning on your computer
Podman
Importing Windows into Proxmox virtualization
Docker and PHP mail
Proxmox virtualization
Docker and Cron
Lenovo ThinkPad X1 Carbon: LTE modem EM7544 commissioning
Preparing a Linux server to run a web application in Python
How to address poor file share performance in Docker
How to get started using Docker correctly
Installing Linux on a dedicated HPE ProLiant DL320e server
How to stress test a web application
Why use the JFS filesystem
How to boot from a 4TB drive with GTP using UEFI
Btrfs file system
Raspberry PI
WINE - running Windous programs under Linux
GNU/Linux operating system

Newsletter

If you are interested in receiving occasional news by email.
You can register by filling in your email news subscription.


+