1. Introduction
This article briefly outlines some knowledge about Embedded Linux, serving as a reference for those looking 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 experiment with it!
2. What to Learn About Embedded Linux?
1. Understanding Linux

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

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

The three most important parts of Embedded Linux software are <span>Bootloader</span>
, <span>Linux Kernel</span>
, and <span>Root File System</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 starts, 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 that has been ported 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 that has been ported by the chip manufacturer to fit our board.
(2) Linux Kernel
The Linux Kernel is an open-source <span>monolithic kernel</span>
Unix-like operating system. The Linux kernel we need to learn to port is also based on the kernel package provided by the chip manufacturer. The kernel source directory is as follows:

(3) Root File System
The root file system (rootfs) is the first file system 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 from the root file system after it is mounted.
The importance of the root file system is akin to that of the system disk on our computer; without this system disk, we cannot install our system. The root file system 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 major components mentioned above have already created a complete Embedded Linux environment for us.
With such an 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.
The Device Tree describes the device tree file. This DTS file adopts a tree structure to describe board-level devices, such as the number of CPUs, memory base addresses, which devices are connected to the IIC interface, and which devices are connected to the SPI interface, etc.
(5) Linux Applications
In Linux, everything is a file. In C programming, we all know that file operations include opening files, reading and writing files, and closing files.
In Embedded Linux application programming, our focus is also on how to operate these files (device files, etc.) using operations like open, close, read, write, etc.
3. Some Experience
Learning Embedded Linux is significantly more challenging than learning microcontrollers; not only is there more content to learn, but just familiarizing oneself with the development environment (Linux environment, cross-compiler, Makefile, etc.) involves a lot of material.
In terms of depth, it is also 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.
Based on my experience from starting to giving up, beginning with Linux drivers and applications is a better approach. Do not jump straight into those three giants at the outset, as it is easy to go from beginner to giving up…
Prepare to endure hardships while learning this, as many issues may drive you crazy. For instance, you may follow a tutorial, but the final result could be different, leading to numerous problems, which is entirely normal.
Sometimes, a seemingly singular issue can lead to other problems, so patience is essential for resolution.
For example, when I compiled the Linux kernel previously, I encountered the following issue:

According to the problem description, I was missing something called <span>lzop</span>
, so I installed it as prompted, but then another issue arose:

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

My experimental method was identical to the tutorial, including the development environment provided by the tutorial, yet issues still arose with exactly the same operations; how much more so when one has to set up their environment, increasing the chances of errors.
Regardless, do not give up so easily!
3. Conclusion
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 superficial knowledge; we will learn and share more in-depth and detailed knowledge together in the future.
Due to recent changes in the WeChat public platform push rules, many readers have reported not seeing updated articles in time. According to the latest rules, it is recommended to click on “Recommended Reading, Share, Collect”, etc., to become a regular reader.
Recommended Reading:
-
“The job market changes daily; this year, finding a job is tough!”
-
Feeling helpless to “lie flat”? Exposing a well-known factory shutting down for 3 months!
-
Japanese media analyzes Huawei phones: self-research proportion rises, hardware surprises abound
Please click 【View】 to give the editor a thumbs up
