August 5, 2020

Exploring the Armbian sources - linux startup

At some point a call is made to start_kernel(). Maybe. Depending on the architecture. Whatever the case, but a lot happens before a call like that. Some kind of ARM specific assembly code must get the show started. Also a fair bit of platform specific hardware initialization needs to be done. It is the purpose of this investigation to examine hardware initialization before hardware independent linux code can start running.

Startup messages look like this:

Found U-Boot script /boot/boot.scr
3033 bytes read in 3 ms (987.3 KiB/s)
## Executing script at 4fc00000
U-boot loaded from SD
Boot script loaded from mmc
165 bytes read in 3 ms (53.7 KiB/s)
29743 bytes read in 6 ms (4.7 MiB/s)
4191 bytes read in 6 ms (681.6 KiB/s)
Applying kernel provided DT fixup script (sun50i-h5-fixup.scr)
## Executing script at 44000000
11889178 bytes read in 569 ms (19.9 MiB/s)
17162752 bytes read in 820 ms (20 MiB/s)
## Loading init Ramdisk from Legacy Image at 4fe00000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    11889114 Bytes = 11.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
   Loading Ramdisk to 494a9000, end 49fff9da ... OK
   Loading Device Tree to 0000000049439000, end 00000000494a8fff ... OK

Starting kernel ...
Armbian 20.05.2 Buster ttyS0

A lot of interesting stuff is in arch/arm64/kernel.
In particular head.S has early startup code including a
branch to start_kernel()


Have any comments? Questions? Drop me a line!

Tom's electronics pages / tom@mmto.org