After learning the structure of Linux Through LFS, We can find several embedded components: bootloader, Linux kernel, and root file system.
It starts with Bootloader and from the moment the CPU is powered on.
After some searches, we found out that uboot and VIVI are two popular bootloaders on this platform. In view of the simplicity of Vivi, we started with Vivi and found the head. S is the entry of bootloader. It analyzes data row by row, from the simplest lighting, to the output UART, to copying NAND to ram, to the C program, in the meantime, with the help of "complete development tutorial of S3C2410", we can basically figure it out. If you don't understand it, you can search for this article.
I will talk about several issues that have plagued me for a long time during debugging:
1: one is to jump to ram, how to implement it, that is, through the ldr pc, = step2, = step2 is the running address set when LD, note the difference between using LDR as a pseudo command and loading command
_ Start:
B Step1 @ B operations are relative positions
Step 1: @ indicates the connection address. For example, the 0x30000000 dynamic library redirection address should also be the same. The loaded address is different.
Ldr pc, = step2 @ LDR operation is to fill in the absolute address, that is, the connection address, to achieve the jump
Step 2:
B Step 2
2: Set the gpio port. The light port of this development board is gpio_ B.
MoV R1, # gpio_ctl_base
Add R1, R1, # ogpio_ B
LDR R2, = 0x155555 @ set 11 pins for output, two describing one pin