August 6, 2020

Armbian boot and disk layout

With the Armbian SD card in my desktop card reader, I see:
fdisk /dev/sdf
Command (m for help): p
Disk /dev/sdf: 14.86 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Device     Boot Start      End  Sectors  Size Id Type
/dev/sdf1        8192 30805119 30796928 14.7G 83 Linux
So, we have 8M of unpartitioned disk followed by a linux ext4 filesystem.

The /boot directory looks like the following. The dtb subdirectory contains a myriad of files that we may investiage later.

[root@trona boot]# ls -l
total 44080
-rw-r--r-- 1 root root      165 Aug  5 17:17 armbianEnv.txt
-rw-r--r-- 1 root root     1536 Jun  8 09:46 armbian_first_run.txt.template
-rw-r--r-- 1 root root   230454 Jun  8 09:46 boot.bmp
-rw-r--r-- 1 root root     2961 Jun  8 09:33 boot.cmd
-rw-r--r-- 1 root root     4882 Jun  8 09:46 boot-desktop.png
-rw-rw-r-- 1 root root     3033 Jun  8 09:47 boot.scr
-rw-r--r-- 1 root root   186877 Jun  2 08:20 config-5.4.43-sunxi64
lrwxrwxrwx 1 root root       18 Jun  8 09:36 dtb -> dtb-5.4.43-sunxi64
drwxr-xr-x 3 root root     4096 Jun  8 09:36 dtb-5.4.43-sunxi64
lrwxrwxrwx 1 root root       22 Jun  8 09:36 Image -> vmlinuz-5.4.43-sunxi64
-rw-r--r-- 1 root root 11889114 Jun  8 09:49 initrd.img-5.4.43-sunxi64
-rw-r--r-- 1 root root  3739140 Jun  2 08:20 System.map-5.4.43-sunxi64
lrwxrwxrwx 1 root root       22 Jun  8 09:49 uInitrd -> uInitrd-5.4.43-sunxi64
-rw-r--r-- 1 root root 11889178 Jun  8 09:49 uInitrd-5.4.43-sunxi64
-rwxr-xr-x 1 root root 17162752 Jun  2 08:20 vmlinuz-5.4.43-sunxi64

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