I have been engaged in Embedded Linux for more than a year. If I had learned this course during my college years, I would have had more than two years of experience. During this period, I also wrote the underlying bootloader, kernel drivers, and upper-layer applications. I have also used FPGA's OpenGL for the modules inside the chip in college, so I have a little understanding of the entire embedded framework. I always wanted to sort it out and was busy with my work. He accidentally sprained his foot when playing the ball last Saturday. Alas, he is still playing plaster. Now let's talk about my personal understanding. If any deviation exists, please kindly advise!
First, let's take a look at the simplest framework.
About bootloader
1. When the board is powered on, because the chip has the boot function, it will automatically start the code from flash and execute the processing. The code here is actually the first stage of bootloader. In fact, bootloader has the functions of boot and loarder. Boot is to move the code, guide, and loarder is to load all the required drivers.
2. What does bootloader do in the first stage.
3. The first stage of bootloader is the assembly code, and the second stage is the C code. Here, we initialize the necessary peripheral devices, such as the NIC Driver and serial port driver, and then start the kernel.
4. Start the kernel either from the network or from the SD/emmc card. It is mainly to give the kernel code to loard into the DDR and then execute it.
The memory distribution of bootloader is as follows:
IP core in the chip (Controller of each module)
Some IP cores in the chip, namely the controllers of each module, are actually implemented through FPGA. FPGA is a field programmable gate array. Take the I2C controller for example. I2C is mainly the SDA and SCL lines, and the function is to transmit data. A lot of logic can be implemented inside the IP core. For example, when you want to send a device address, configure the Register. The state machine of this module obtains the data, then the data sent from the SDA line is from the device address, then the device will respond to a low level, then the SDA line of this module has this low level, the device address is correctly sent. However, we do not need to know how to process the IP core. We only need to configure a data register, and then the module will process the data accordingly. Of course, the simulation method can be used, so this is the role of the IP core, with the configuration register to implement the function, thus hiding the internal working sequence, encapsulation is very good.
The same principle applies to other modules.
About Kernel
When bootloader puts the kernel code loard into the DDR, it is necessary to start the kernel. The kernel startup is as follows:
After the kernel is started, the user's init daemon will be called.
About Linux File System
After the kernel is called to the Linux file system, you can run the program on the console terminal. It is not very different from the Linux operating system.
About Android File System
After finding the android INIT program. The following figure shows the android startup process.
From the above, we can know how our mobile phone or pad is implemented. In fact, embedded Linux is just like this, but to learn this well, there are still a lot of things to be accumulated and learned.
But first, you can get a better picture of the global situation and then learn it more deeply.