This article briefly outlines some knowledge about Embedded Linux, providing a reference for those who want to advance from microcontrollers to Embedded Linux.
With the increasing number of tutorials on Embedded Linux, I believe many friends studying microcontrollers have started to explore this area!
1. What to Learn About Embedded Linux?
1. Understanding Linux

Some friends studying microcontrollers may already have some foundation in Linux, but there are also those who have never used Linux, and even some beginners may not have heard of it. To accommodate these friends, let’s briefly understand Linux:

2. Understanding Embedded Linux
When learning Embedded Linux, we need to focus on the following key areas:

The three most important parts of Embedded Linux software are <span>Bootloader</span>
, <span>Linux kernel</span>
, and <span>root filesystem</span>
. With these three components, we have a minimal, complete, and runnable embedded system.
(1) BootLoader
<span>BootLoader</span>
is a piece of code that runs before the operating system, used to <span>boot the operating system</span>
. There are many open-source <span>BootLoaders</span>
, such as RedBoot, U-Boot, etc., among which <span>U-Boot</span>
is the most commonly used. The source code of U-Boot is quite large:

Our focus in learning is to understand how to modify the U-Boot provided by the chip manufacturer to adapt it to our board:

The term <span>U-Boot porting</span>
usually refers to the process of modifying the U-Boot provided by the chip manufacturer to fit our board.
(2) Linux Kernel
The Linux kernel is an open-source, monolithic operating system. The Linux kernel we need to learn to port is also the one provided by the chip manufacturer. The kernel source directory is as follows:

(3) Root Filesystem
The root filesystem (rootfs) is the first filesystem mounted when the kernel starts, where the kernel code image file is stored.
The system boot program will load some basic initialization scripts and services into memory for execution after the root filesystem is mounted.
The importance of the root filesystem is akin to the system disk on our computers; with this system disk, we can install our system. The root filesystem has a root directory <span>/</span>
, which contains many subdirectories:

(Image source: Baiwen Network)
(4) Linux Drivers
Linux drivers should be our starting point and focus when learning Embedded Linux. The three components mentioned above have already created a complete Embedded Linux environment for us.
With this environment, our Linux drivers can be installed on it. Linux drivers:

There are three main types of drivers in Linux: character device drivers, block device drivers, and network device drivers.
Device Tree: The file that describes the device tree. This DTS file uses a tree structure to describe board-level devices, such as the number of CPUs, memory base addresses, and devices connected to IIC and SPI interfaces, etc.
(5) Linux Applications
In Linux: everything is a file. In C programming, we know that file operations involve opening files, reading and writing files, and closing files.
In Embedded Linux application programming, we also focus on how to operate (open, close, read, write, etc.) these files (device files, etc.).
3. Some Experiences
Learning Embedded Linux is significantly more challenging than learning microcontrollers. Not only has the content increased, but just getting familiar with the development environment (Linux environment, cross-compiler, Makefile, etc.) involves a lot of material.
In terms of depth, it is much deeper than microcontrollers. For example, previously learning STM32 involved IDE compilation, while Embedded Linux involves compiling directly with a compiler or using compilation scripts.
From my experience of starting and giving up, it is better to begin learning from Linux drivers and applications rather than diving straight into those three giants above, or you might easily give up…
Be prepared to endure hardships while learning this, as many issues may drive you crazy. For instance, following a tutorial might yield different results, and many problems might arise, which is perfectly normal.
Sometimes a seemingly simple issue can lead to other problems, so patience is key to resolving them.
For example, when I compiled the Linux kernel previously, I encountered the following issue:

According to the problem description, something called <span>lzop</span>
was missing. After installing it as suggested, another issue arose:

Then I had to search online for solutions, trying each method one by one until I finally resolved it:

My experimental methods were the same as those in the tutorial, including the development environment provided by the tutorial. Even with identical operations, issues can arise, and when setting up the environment yourself, the chances of errors increase.
Regardless, never give up so easily!
4. Final Thoughts
The knowledge of Embedded Linux is not limited to what has been mentioned above, but it basically covers our main learning content. The concepts mentioned above are just some surface-level knowledge, and we will continue to learn and share more in-depth and detailed knowledge together.

END
→ Follow for more updates ←