2.2. ABL entry point and top-level orchestration¶
This page covers the ABL DXE from its PE entry point through the top-level
LinuxLoaderEntry call sequence, and the Board.c platform-identification
path it drives — call order only; the individual subsystems it dispatches to
are documented on their own pages and only cross-referenced here (kernel
hand-off → Kernel/DTB/ramdisk load and the kernel hand-off; AVB → AVB enforcement code path (LoadImageAndAuth / libavb);
fastboot → Fastboot handler internals (FastbootLib); key/boot-mode detection →
Physical keys: power, volume, and the boot-mode dispatcher; the full function inventory →
ABL function map and upstream-source correlation).
RVAs are LinuxLoader-relative (= ABL DXE file offset − 0xb8); runtime =
load base + RVA. All addresses below were read from the decompressed DXE
(../artifacts/abl_a/abl_dxe_fv.bin); the LinuxLoader PE was carved at DXE
offset 0xb8 so that PE file offset == RVA.
2.2.1. PE entry point (entry0)¶
The PE entry point is at RVA 0x1000 (start of .text), a 168-byte
ModuleEntryPoint stub emitted by the EDK2 build (AutoGen.c). It performs
the standard UEFI application prologue — set up the stack cookie, then call the
module’s real entry — and tail-calls LinuxLoaderEntry at RVA 0x12dc
(direct bl from entry0). It carries no boot logic of its own.
Basis: entry0 at 0x1000 has a single outbound call to 0x12dc; the
0x12dc body references the LinuxLoaderEntry Address: 0x%llx and
Loader Build Info: %a %a debug strings emitted by the real entry function
(ABL overview, key handling, fastboot records the .text layout and ImageBase=0).
2.2.2. LinuxLoaderEntry (RVA 0x12dc)¶
LinuxLoaderEntry is the top-level orchestrator (source:
QcomModulePkg/Application/LinuxLoader/LinuxLoader.c). Its call order, read
from the binary and structurally correlated against the matched source (a
version-gapped proxy tag, not a same-version match — see Provenance below), is:
# |
Step (source name) |
Purpose / binary basis |
|---|---|---|
1 |
|
Allocate the thread-unsafe stack and arm the stack cookie. On failure,
branches straight to the |
2 |
|
Record the boot-stat start timestamp. |
3 |
|
Initialise verified boot and read |
4 |
|
Enumerate the GPT and build the in-memory partition table. Basis:
|
5 |
|
Detect A/B and select the active slot (this unit is slot |
6 |
|
Read the boot-time key. |
7 |
|
Decode the reboot cookie: |
8 |
|
Fold BCB/misc recovery request into |
9 |
|
Populate board/chip/platform data (see Board identification). Fatal on
error: |
10 |
|
Probe for hypervisor VM data; logs |
11 |
|
Load and AVB-verify boot/dtbo/recovery into a |
12 |
|
Flush the splash/display, then hand off to the kernel. Hand-off contract on Kernel/DTB/ramdisk load and the kernel hand-off. |
13 |
|
Reached when fastboot was selected or |
14 |
|
Restore |
The observed binary control flow matches this order: the body issues ~15 calls
to the shared debug-print thunk at RVA 0x2148 interleaved with the step
calls above, and branches into the key/boot-mode routines at 0x1964
(PON reason), 0x1bfc (BootIntoMode) and 0x1e0c
(GetBootIntoModeRecovery).
Note
Analyzer boundary artifact. radare2’s auto-analysis merges
LinuxLoaderEntry with the downstream key/boot-mode-detection cluster into
one 3700-byte function spanning 0x12dc–0x2150 (the routines
Physical keys: power, volume, and the boot-mode dispatcher documents at 0x15d0 / 0x1638 /
0x1690 / 0x1968 / 0x1bfc / 0x1e0c are basic blocks inside this
span, not separate function starts, because control reaches them by
conditional branch and they share the stack_guard_update_default tail).
The logical decomposition is the source’s; the merge is noted in the
deviations/analysis column of ABL function map and upstream-source correlation.
2.2.3. Board identification (Board.c)¶
BoardInit populates the board record that later drives DTB selection,
fastboot getvar and the kernel command line. Platform identity is obtained
by runtime UEFI protocol query, not from any static SoC table compiled into
ABL:
GetChipInfo→gBS->LocateProtocol (&gEfiChipInfoProtocolGuid …)then the protocol’s chip-id/version/foundry/modem getters. Basis (RVA0x12248, Board.c chip-id-string helper):Locate Protocol failed for gEfiChipInfoProtocolGuid,Failed to Get the ChipIdString,Error: HW Platform string is NULL.GetPlatformInfo→gBS->LocateProtocol (&gEfiPlatformInfoProtocolGuid …)thenhPlatformInfoProtocol->GetPlatformInfo (…, &PlatformInfo); the result is bounds-checked againstEFI_PLATFORMINFO_NUM_TYPES. Basis (RVA0x11740, Board.c board-init/dump):Error: Failed to locate PlatformInfo protocol.,Error: GetPlatformInfo failed.,Error: Unknown platform type (%d)..
BoardInit (RVA 0x11740) then logs the resolved identity —
Raw Chip Id : 0x%x, Chip Version : 0x%x, Foundry Id : 0x%x,
Platform Info : 0x%x, HLOS SubType : 0x%x, Fusion Value : %d — and
the accessors BoardPlatformType / BoardPlatformChipVersion /
BoardPlatformFoundryId / BoardTargetId read back the cached
platform_board_info struct. Because both identity sources are
LocateProtocol results resolved at run time, ABL carries no hard-coded
SM6350 platform-type table; the SoC identity documented in ABL overview, key handling, fastboot
(lagoon / msm-id 0x1b2) is what these protocols return on this unit, not
a constant baked into LinuxLoader.
2.2.4. Provenance¶
- Source:
../artifacts/abl_a/abl_dxe_fv.bin(decompressed ABL DXE; LinuxLoader PE carved at DXE offset0xb8so PE offset == RVA). Matched upstream source for structural correlation only:QcomModulePkg/Application/LinuxLoader/LinuxLoader.candQcomModulePkg/Library/BootLib/Board.cat CodeLinaro tagLA.UM.9.12.1.r2-05100-SMxx50.QSSI12.0(a QSSI12/Android-12 build; the version gap to this Android-11 unit is an open question — see ABL function map and upstream-source correlation and Open questions and limits of analysis).- Method:
radare2 (base 0) disassembly and call-graph; per-function string evidence resolved by decoding AArch64
adrp/addliteral pairs with Capstone (r2’s own xref inference does not resolve these).entry0``→ ``0x12dcedge and theLinuxLoaderEntrycall order read from the binary; step names correlated toLinuxLoader.c/Board.c. The0x12dcfunction-boundary merge is a radare2 auto-analysis artifact, stated as such — the binary is unmodified.- Cross-refs:
ABL overview, key handling, fastboot (container layout,
.text/.datamap), Kernel/DTB/ramdisk load and the kernel hand-off (kernel hand-off), AVB enforcement code path (LoadImageAndAuth / libavb) (DeviceInfoInit/LoadImageAndAuth), Fastboot handler internals (FastbootLib) (FastbootInitialize), Physical keys: power, volume, and the boot-mode dispatcher (GetKeyPressand the boot-mode machine), ABL function map and upstream-source correlation (full reachable-function inventory).