Bare-Metal & Bootloader Bring-Up Fault Triage

Triage unzeroed .bss cold/warm reset heisenbugs, ARMv7-A AAPCS32 8-byte SP alignment faults on 64-bit printf/LDRD, U-Boot PHY/bootargs traps, and VFS rootfs panics.

20 minfree previewLinux 6.12C11glibc 2.39→ module 5 lab
What you'll learn
  • Diagnose warm-vs-cold reset nondeterminism and printf("%lld") / LDRD Data Abort crashes caused by unzeroed .bss or 4-byte-misaligned ARMv7-A stack pointers.
  • Triage U-Boot RMII Ethernet PHY reset timing, NULL phydev Data Abort traps, and truncated bootargs environment strings.
  • Implement a C11 bring-up fault-triage engine (lab_m05_boot_fault_triage) decoding straps, AAPCS32/.bss startup bounds, and VFS rootfs panic signatures.

Silent C Runtime Preconditions That Linux User Space Hid From You

When you run ./verify on an Ubuntu host, Linux kernel execve() and glibc _start quietly prepare a pristine C11 execution environment before main() runs: anonymous virtual pages backing .bss are guaranteed zeroed by the MMU, and the kernel aligns the initial user stack pointer to 16 bytes (x86_64) or 8 bytes (ARMv7-A). In bare-metal Cortex-A7 code (GL-E01..E02) or custom SPL, nobody does that unless your start.S and linker script do it explicitly!

Two classic bring-up ghosts follow immediately. First, if start.S forgets to zero __bss_start .. __bss_end, static int initialized; holds random DDR3 power-on charge (or leftover values from the previous warm reset!), making firmware work once and hang on reset. Second, setting ldr sp, =0x80200004 (4-byte aligned, NOT 8-byte aligned!) works fine for int math, then explodes with a Data Abort or prints corrupted garbage the instant you call printf("%llu", ticks) because ARMv7-A AAPCS32 aligns 64-bit va_arg parameters and LDRD/STRD doubleword loads on 8-byte stack boundaries!

fig_m05_l03_a.svg — Every bring-up hang localizes cleanly to one boundary:…

Figure 5.3a. Every bring-up hang localizes cleanly to one boundary: POR straps, start.S ABI, U-Boot env/PHY, or Kernel VFS.

mental model: Bringing up bare-metal C or U-Boot without zeroing .bss and 8-byte-aligning SP is like moving into a lab bench without sweeping last week's loose wire clippings off the ESD mat: trivial 1-wire probes work by luck until a wide connector shorts across residual debris.

Where it stops working: Fixing startup assembly and bootargs resolves deterministic software contract bugs; unstable DDR3 calibration or brownout rails on VDD_SOC_IN require oscilloscope eye/rail checks.

definition (AAPCS32 8-Byte Stack Alignment): Defined by the Procedure Call Standard for the ARM Architecture (AAPCS32, section 6.2.1.2), this ABI rule requires SP mod 8 == 0 at every public function call interface so 64-bit integers (uint64_t), double floats, variadic va_list 8-byte arguments, and LDRD/STRD instructions execute at naturally aligned doubleword addresses without alignment traps.

ast_m05_l03.svg — Zero .bss, enforce SP % 8 == 0 (bic sp,sp,#7), check…step 1/4
  1. Step 1. bic sp, sp, #7 guarantees 8-byte alignment even if a symbol or linker expression shifts by 4 bytes.
  2. Step 2. PHY ID 0xFFFF means MDIO pull-up/pinmux is missing or the PHY is still held in hardware reset.
  3. Step 3. An unescaped semicolon inside setenv bootargs '...; root=/dev/nfs' runs root= as a U-Boot command!
  4. Step 4. Major 179 is MMC/SD; adding rootwait tells VFS to wait until USDHC finishes asynchronous probing.

Figure 5.3b. Zero .bss, enforce SP % 8 == 0 (bic sp,sp,#7), check bootargs length, and add rootwait on mmcblk.

Decoding U-Boot Data Aborts and Kernel VFS Panic Signatures

Once U-Boot reaches its console, two subtle configuration traps dominate network and kernel bring-up. First, on i.MX6ULL ENET1/ENET2 boards using LAN8720A or KSZ8081 RMII PHYs, if the Device Tree omits phy-reset-gpios / phy-reset-duration = <15> or mismatches reg = <0> vs <1> MDIO address, mdio list misses the PHY; older vendor patches that dereference phydev without a NULL check trigger a U-Boot pc : [<...>] data abort right inside ping or tftpboot! Second, inside setenv bootargs ..., forgetting quotes around ; or exceeding CONFIG_SYS_CBSIZE truncates the tail of the kernel command line silently.

When Linux kernel 6.12 panics with VFS: Unable to mount root fs on <dev>, read the (major, minor) pair literally rather than guessing! unknown-block(0,0) means the kernel had no block device for root= — either bootargs lost root=..., or root=/dev/nfs was passed to a kernel compiled without CONFIG_ROOT_NFS=y / ip=.... Conversely, unknown-block(179,2) (major 179 = mmcblk) happens when VFS runs before the asynchronous USDHC host controller finishes card detection — cured instantly by rootwait.

fig_m05_l03_b.svg — Major number 179 identifies MMC/SD block devices; (0,0)…

Figure 5.3b. Major number 179 identifies MMC/SD block devices; (0,0) indicates no block device matched root=.

Observed Bring-Up SymptomExact Primary SignalUnderlying Root CauseDeterministic Fix
Works on 1st download, fails after warm resetStatic globals non-zero at main() entrystart.S omitted .bss zero loopZero [__bss_start, __bss_end) before bl main
int prints fine; printf("%lld", x) crashes/garblesSP = 0x80200004 (SP & 7 == 4)Violated AAPCS32 8-byte stack alignmentExecute bic sp, sp, #7 in start.S + ALIGN(8) in .lds
U-Boot TFTP says PHY not found / Data Abortmdio list empty or 0xFFFFMissing RMII PHY GPIO reset pulse or wrong MDIO regSet phy-reset-gpios, >= 10 ms duration, verify MDIO addr 0/1
VFS: Unable to mount root fs on unknown-block(179,2)mmc1: new high speed MMC card prints after panic!VFS raced ahead of async USDHC card probeAppend rootwait rw rootfstype=ext4 to U-Boot bootargs
learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03$ bat -H 11 -H 27 armv7_bringup_guard.h File: armv7_bringup_guard.h    /* SPDX-License-Identifier: GPL-2.0 */    #ifndef KSA_ARMV7_BRINGUP_GUARD_H    #define KSA_ARMV7_BRINGUP_GUARD_H        #include <stdbool.h>    #include <stdint.h>        /*     * Reference ARMv7-A CRT0 startup sequence (start.S):     *   ldr sp, =_stack_top   *   bic sp, sp, #7              @ Enforce AAPCS32 8-byte stack alignment     *   ldr r0, =__bss_start     *   ldr r1, =__bss_end     *   mov r2, #0     * 1: cmp r0, r1     *   strlo r2, [r0], #4          @ Requires 4-byte aligned __bss_start/__bss_end     *   blo 1b     *   bl main     */        #define ARM_AAPCS32_SP_ALIGN    8U    #define IMX_SD_IVT_OFFSET       0x400U    #define LINUX_MMC_BLOCK_MAJOR   179U        static inline bool armv7_crt0_bounds_valid(uint32_t sp, uint32_t bss_start, uint32_t bss_end)    {  	if ((sp & (ARM_AAPCS32_SP_ALIGN - 1U)) != 0U)    		return false;    	if (bss_end < bss_start)    		return false;    	if (((bss_start | bss_end) & 0x3U) != 0U)    		return false;    	return true;    }        #endif /* KSA_ARMV7_BRINGUP_GUARD_H */
  1. bic sp, sp, #7 clears bits [2:0] so 64-bit LDRD/STRD and variadic %lld calls stay 8-byte aligned.
  2. Checks 8-byte SP alignment alongside 4-byte word bounds required by strlo r2, [r0], #4.
bootz(U-Boot) / kernel-parameters(7)(7) at a glance — GL-E00
bootz(U-Boot) / kernel-parameters(7)(7) GL-E00 Quick Reference bootz(U-Boot) / kernel-parameters(7)(7)        U-Boot & Linux 6.12 ROOTFS BOOTARGS TEMPLATES # eMMC / SD ext4 boot       (note mandatory 'rootwait'!) setenv bootargs 'console=ttymxc0,115200       root=/dev/mmcblk1p2 rootfstype=ext4 rw rootwait'        # Raw SLC NAND UBIFS boot (note quotes protecting ';' in mtdparts if       present!) setenv bootargs 'console=ttymxc0,115200 ubi.mtd=4       root=ubi0:rootfs rootfstype=ubifs rw'        # NFSv3 network rootfs boot (requires CONFIG_ROOT_NFS=y and static       Bench NIC!) setenv bootargs 'console=ttymxc0,115200 root=/dev/nfs       nfsroot=192.168.10.1:/srv/nfs/rootfs,v3,tcp       ip=192.168.10.50:192.168.10.1:192.168.10.1:255.255.255.0::eth0:off rw' Kernel Systems Academy   Lesson 5.3    bootz(U-Boot) / kernel-parameters(7)(7) GL-E00 quick reference · full manual page: man 7 bootz(U-Boot) / kernel-parameters(7) 

Modeling AAPCS32 Stack Alignment and VFS Panic Triage in Host C11

In verify.c, we prove mathematically why an odd-word SP (0x80200004) corrupts AAPCS32 64-bit stack-argument offsets (ROUND_UP(offset, 8)), verify .bss 4-byte clear bounds so strlo r2, [r0], #4 never overwrites 1..3 bytes of .data/stack past __bss_end, and classify three canonical VFS panic scenarios.

Completing this walkthrough prepares you directly for lab_m05_boot_fault_triage, where you will repair and benchmark the full bring-up diagnostic library.

learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03$ bat -H 10 -H 29 verify.c File: verify.c    #define _POSIX_C_SOURCE 200809L    #include <stdbool.h>    #include <stdint.h>    #include <stdio.h>    #include <string.h>        static uint32_t aapcs32_u64_stack_addr(uint32_t sp_at_call, uint32_t slot_off)    {    	/* AAPCS32 aligns 8-byte stack args to 8-byte offset RELATIVE to SP (assumed % 8 == 0)! */  	uint32_t rel_aligned = (slot_off + 7U) & ~7U;    	return sp_at_call + rel_aligned;    }        static const char *classify_vfs_panic(const char *bootargs, uint32_t major)    {    	if (strstr(bootargs, "root=") == NULL)    		return "TRUNCATED_OR_MISSING_ROOT_ARG";    	if (strstr(bootargs, "root=/dev/nfs") != NULL && major == 0U)    		return "MISSING_CONFIG_ROOT_NFS_OR_IP_ARG";    	if (major == 179U && strstr(bootargs, "rootwait") == NULL)    		return "ASYNC_MMC_MISSING_ROOTWAIT";    	return "CHECK_ROOTFSTYPE_OR_PARTUUID";    }        int main(void)    {    	uint32_t bad_sp = 0x80200004U;    	uint32_t fixed_sp = bad_sp & ~7U; /* bic sp, sp, #7 -> 0x80200000 */  	uint32_t bad_u64_addr = aapcs32_u64_stack_addr(bad_sp, 4U);    	uint32_t good_u64_addr = aapcs32_u64_stack_addr(fixed_sp, 4U);        	const char *p_trunc = classify_vfs_panic("console=ttymxc0,115200", 0U);    	const char *p_nfs = classify_vfs_panic("console=ttymxc0,115200 root=/dev/nfs rw", 0U);    	const char *p_mmc = classify_vfs_panic("console=ttymxc0,115200 root=/dev/mmcblk1p2 rw", 179U);        	if ((bad_u64_addr & 7U) == 0U || (good_u64_addr & 7U) != 0U)    		return 1;        	printf("AAPCS32 bad_sp=0x%08X u64_addr=0x%08X(mod8=%u) fixed_sp=0x%08X u64_addr=0x%08X(mod8=%u)\n",    	       bad_sp, bad_u64_addr, bad_u64_addr & 7U,    	       fixed_sp, good_u64_addr, good_u64_addr & 7U);    	printf("VFS_TRIAGE case1=%s case2=%s case3=%s\n", p_trunc, p_nfs, p_mmc);    	return 0;    }
  1. Compiler aligns 64-bit arg offsets assuming entry SP % 8 == 0; if SP % 8 == 4, physical addr % 8 == 4!
  2. bic sp, sp, #7 (bad_sp & ~7U) restores 0x80200000 so every 8-byte stack slot lands on mod8 == 0.

Confirming 64-Bit Slot Misalignment and VFS Cause Isolation

Look at AAPCS32 in the execution capture: the compiler carefully rounded slot_off = 4 up to +8 assuming SP obeyed the ABI, yet because bad_sp started at 0x80200004, 0x80200004 + 8 = 0x8020000C (mod8 = 4!) — guaranteed to fault any alignment-checked LDRD! Applying bad_sp & ~7U (bic sp, sp, #7) places the uint64_t slot at 0x80200008 (mod8 = 0).

VFS_TRIAGE likewise separates truncated bootargs, NFS kernel-config/IP omissions, and missing rootwait on major 179 (mmcblk) without guesswork.

learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03gcc -std=c11 -Wall -Wextra -Werror verify.c -o verifylearner@ksa:~/gl-e00/m05-l03./verifyAAPCS32 bad_sp=0x80200004 u64_addr=0x8020000C(mod8=4) fixed_sp=0x80200000 u64_addr=0x80200008(mod8=0)VFS_TRIAGE case1=TRUNCATED_OR_MISSING_ROOT_ARG case2=MISSING_CONFIG_ROOT_NFS_OR_IP_ARG case3=ASYNC_MMC_MISSING_ROOTWAITlearner@ksa:~/gl-e00/m05-l03
strace — learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03strace -e trace=write,exit_group ./verifywrite(1, "AAPCS32 bad_sp=0x80200004 u64_ad"..., 222) = 222exit_group(0)                           = ?+++ exited with 0 +++

Subtle Linker, U-Boot Semicolon, and DTB Address Collisions

Keep one habit across every bring-up session in GL-E01..GL-E07: whenever boot fails, scroll up from the panic line to find the earliest warning (mdio, regulator, mmc, nfs, or Kernel command line: ... printed near 0.000000). The kernel literally echoes the exact bootargs string it received from U-Boot near the top of dmesg!

Comparing Kernel command line: in dmesg against what you thought setenv bootargs set catches 90% of semicolon and truncation mistakes in five seconds.

Unquoted Semicolon in mtdparts Truncating bootargs Inside U-Boot:

  • Symptom: Running setenv bootargs console=ttymxc0,115200 mtdparts=gpmi-nand:4m(boot); root=ubi0:rootfs prints Unknown command 'root=ubi0:rootfs' or silently drops root=!
  • Root Cause: U-Boot's Hush shell treats an unquoted ; as a command separator, ending setenv bootargs early and trying to execute the remainder as a shell command.
  • Fix: Always wrap the entire bootargs value in single quotes (setenv bootargs '...') and verify the full stored value with printenv bootargs.

Word-Loop .bss Clear Overwriting Adjacent Stack When __bss_end Is Unaligned:

  • Symptom: Adding a single static char flag; at the end of .bss causes start.S to corrupt 3 bytes of the section immediately following __bss_end.
  • Root Cause: A 4-byte strlo r2, [r0], #4 loop writes a full 32-bit word on its final iteration if __bss_end - __bss_start is not a multiple of 4 bytes.
  • Fix: Enforce . = ALIGN(4); __bss_end = .; inside the linker script .bss output section and verify ((bss_start | bss_end) & 3) == 0.

Guided Practice

Add a U-Boot memory-overlap check check_bootz_overlap(uint32_t zimg_addr, uint32_t zimg_len, uint32_t dtb_addr, uint32_t dtb_len) to verify.c: if an engineer loads a 9 MiB zImage at 0x80800000 (0x80800000 .. 0x81100000) and mistakenly loads .dtb at 0x81000000 instead of 0x83000000, what happens to the 0xD00DFEED FDT header?

Verify your overlap check catches zimg_addr + zimg_len > dtb_addr before bootz jumps into a corrupted Device Tree.

Independent Practice

Open labs/lab_m05_boot_fault_triage/ and inspect starter/core.c. Fix the three intentional bugs in decode_boot_straps(), validate_startup_abi(), and triage_vfs_boot_panic() (BMOD shift/mask, 8-byte AAPCS32 SP mask vs 4-byte mask, and major == 179 rootwait check).

Run sh check.sh to pass all 5/5 TAP version 13 checks and run ./files/lab_cli --bench to inspect CLOCK_MONOTONIC host diagnostic percentiles.

Verification Checks

quiz · 1 of 3

A bare-metal ARMv7-A program initializes ldr sp, =0x80200004 in start.S. Simple GPIO LED loops run fine, yet calling snprintf(buf, sizeof(buf), "%llu", counter64) triggers a Data Abort or prints garbage. Why?

quiz · 2 of 3

Linux kernel 6.12 boots from eMMC and prints VFS: Unable to mount root fs on unknown-block(179,2), followed 40 ms later by mmc1: new high speed MMC card at address 0001. What is missing from U-Boot bootargs?

quiz · 3 of 3

Retrieval check from Lesson 4.2: When an ENET driver's probe() fails because the RMII PHY never responds on MDIO after clk_prepare_enable() and devm_platform_ioremap_resource(), what must its cleanup path ensure?

i.MX6ULL Boot-Strap Decoder, AAPCS32/.bss Guard & VFS Panic Triage Engine

env: host

1. Motivation

Early board bring-up failures rarely print polite stack traces: wrong BOOT_MODE switches produce total silence, 0x80200004 stacks crash only inside 64-bit printf, and missing rootwait panics VFS 40 ms before eMMC probes.

In this studio, you implement a deterministic C11 bring-up diagnostic engine that decodes hardware strap registers, validates AAPCS32/.bss/IVT invariants, and classifies VFS boot panics.

2. Learning objectives

  • Extract SRC_SBMR2[25:24] (BMOD) and SRC_SBMR1 (BOOT_CFG1/BOOT_CFG2) bitfields alongside 3-wire CRTSCTS console deadlock detection.
  • Enforce 8-byte AAPCS32 stack alignment (sp & 7 == 0), 4-byte .bss section bounds, and 0x400 SD/eMMC IVT placement.
  • Classify U-Boot CONFIG_SYS_CBSIZE truncation, NFS ip= omissions, and major 179 (mmcblk) missing-rootwait VFS panics.

3. Environment requirements

All automated verification steps run in unprivileged user space on a POSIX Linux host using gcc -std=c11 -Wall -Wextra -Werror and clock_gettime(CLOCK_MONOTONIC). Recorded transcripts in captures.json were generated on x86_64 running kernel 7.0.0-42-generic and prove protocol, state-machine, and memory invariants only. Physical bus timing, DMA cache coherency, and board peripheral behavior require target validation on Linux kernel 6.12 LTS (ARMv7-A Cortex-A7).

4. Required software and hardware

  • Host workstation: gcc (-std=c11 -Wall -Wextra -Werror), GNU make, ar (binutils), and POSIX /bin/sh.
  • Target environment (optional hardware step, Section 13): i.MX6ULL ARMv7-A board (SRC_SBMR1 0x020D8004, SRC_SBMR2 0x020D801C) running U-Boot 2025.x and Linux kernel 6.12.

5. Complete executable commands

learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03$ bat script.sh File: script.sh    make -B -C files    ./files/lab_cli    ./files/lab_cli --bench    sh check.sh

6. Annotated source code

files/core.c enforces the production invariants that starter/core.c breaks:

learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03$ bat example.c File: example.c    if ((sp_init & 0x7U) != 0U)    	errs |= STARTUP_ERR_SP_ALIGN8;    if (((bss_start | bss_end) & 0x3U) != 0U)    	errs |= STARTUP_ERR_BSS_ALIGN4;    if (ivt_offset != 0x400U)    	errs |= STARTUP_ERR_IVT_OFFSET;

starter/core.c shifts sbmr2 by 16 instead of 24 (BMOD[25:24]), masks sp_init with 0x3U (4-byte alignment) instead of 0x7U (8-byte AAPCS32 alignment), and disables the missing-rootwait detector on major 179.

7. Expected output

Passing files/ run (sh check.sh, exit code 0):

learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03$ bat listing.txt File: listing.txt    TAP version 13    1..5    ok 1 - builds libcore.a and lab_cli cleanly with -std=c11 -Wall -Wextra -Werror    ok 2 - archives core.o into libcore.a and links independent TAP verifier    ok 3 - decodes SRC_SBMR2[25:24] BMOD and SRC_SBMR1 BOOT_CFG1 straps plus 3-wire CRTSCTS deadlock    ok 4 - enforces ARMv7-A AAPCS32 8-byte SP alignment (sp & 0x7 == 0), 4-byte .bss bounds, and 0x400 IVT offset    ok 5 - classifies truncated bootargs, missing NFS ip= config, and missing rootwait on major 179 mmcblk panics    # pass 5/5

CLI verification output (./files/lab_cli):

learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03$ bat listing.txt File: listing.txt    STRAPS emmc_target=3 tx_deadlocked=1 sdp_override_target=1    CRT0_ABI clean_flags=0x0 broken_flags=0xd    VFS_PANIC mmc_no_rootwait_kind=3

Defective starter/ run (exit code 1): emits FAIL: diagnostics on the broken contract assertions.

8. Explanation of observed behavior

Restoring (sbmr2 >> 24U) & 0x3U aligns with the i.MX6ULL System Reset Controller register map, (sp_init & 0x7U) != 0U rejects 0x80200004 odd-word stacks before LDRD faults occur, and checking strstr(bootargs, "rootwait") catches asynchronous USDHC boot races.

9. Experiment variations

  • Near transfer: Add QuadSPI NOR (BOOT_CFG1[7:4] == 0x1) and ECSPI NOR (0x3 with BOOT_CFG4) decoding to decode_boot_straps().
  • Far transfer: Extend triage_vfs_boot_panic() to validate ubi.mtd= + rootfstype=ubifs pairing for raw GPMI SLC NAND boots.

10. Performance measurements

Recorded host benchmark (./files/lab_cli --bench, CLOCK_MONOTONIC, warmup=5, N=40 batches):

learner@ksa: ~/gl-e00/m05-l03
learner@ksa:~/gl-e00/m05-l03$ bat listing.txt File: listing.txt    BENCH lab_m05_boot_fault_triage clock=CLOCK_MONOTONIC batches=40x500 p50_ns=12696 p95_ns=27228 p99_ns=52499 sink=3

./files/lab_cli --bench measures in-memory C11 bitmask and bootargs classification speed using CLOCK_MONOTONIC (40 x 500 iterations); physical POR_B, MDIO PHY reset (>= 10 ms), and USDHC probe timings must be measured on target hardware.

11. Troubleshooting

SymptomRoot causeFix
Check 3 fails with sd=0 or sdp=5sbmr2 is shifted by 16 instead of 24, reading reserved zeroes instead of BMOD[25:24].Extract (sbmr2 >> 24U) & 0x3U in decode_boot_straps().
Check 4 fails with sp4=0x00x80200004 & 0x3U evaluates to 0, missing the 8-byte AAPCS32 alignment violation.Test (sp_init & 0x7U) != 0U so any non-multiple of 8 sets STARTUP_ERR_SP_ALIGN8.
Check 5 fails with wait=0The rootwait check on root_major == 179U was stubbed out.Restore strstr(bootargs, "rootwait") == NULL returning VFS_FAULT_MMC_MISSING_ROOTWAIT.

12. Guided questions

  1. Why does decode_boot_straps() check bmod (SRC_SBMR2[25:24]) BEFORE inspecting cfg1_hi (SRC_SBMR1[7:4])?
  • *Hint 1:* What happens on physical hardware when BOOT_CFG switches stay set to eMMC while you flip BOOT_MODE to 01 for UUU flashing?
  • *Hint 2:* BOOT_MODE = 01 (Serial Downloader) and 00 (Fuses) override external BOOT_CFG pins completely in the mask Boot ROM.
  1. Why does triage_vfs_boot_panic() check strlen(bootargs) >= cbsize_limit - 1U before checking strstr(bootargs, "root=")?
  • *Hint 1:* Suppose a 1024-byte bootargs line had root=/dev/mmcblk1p2 at byte 1015, chopped off to root=/de by CONFIG_SYS_CBSIZE.
  • *Hint 2:* Checking buffer-limit truncation first identifies why trailing arguments (root= or rootwait) vanished instead of reporting a misleading syntax error.

13. Independent challenges

Implement check_bootz_regions(uint32_t zimg_start, uint32_t zimg_size, uint32_t dtb_start, uint32_t dtb_size) accounting for ARM zImage's ~4x in-place self-decompression expansion so .dtb placement too close above zImage (< 32 MiB gap) is flagged before Kernel_decompress overwrites the FDT!

14. Solutions and explanations

files/core.c decodes SRC_SBMR2[25:24] prior to SRC_SBMR1, enforces 8-byte SP (0x7U mask) + 4-byte .bss + 0x400 IVT invariants, and classifies CBSIZE truncation, NFS, and mmcblk rootwait panics across all 5/5 TAP checks.

Run locally in your terminal and check off each verification milestone.

Not started

Key takeaways

  • Bare-metal ARMv7-A start.S must explicitly zero [__bss_start, __bss_end) before branching to main() because DDR3 powers up with random bit states that corrupt uninitialized C globals.
  • The ARMv7-A AAPCS32 ABI mandates 8-byte stack alignment (SP mod 8 == 0, enforced via bic sp, sp, #7) at public call boundaries so 64-bit LDRD/STRD and printf("%lld") va_arg slots do not fault or misalign.
  • U-Boot ENET TFTP failures and bootargs truncations stem from missing RMII PHY reset pulse/settle timing (>= 10 ms) or unescaped multi-line setenv bootargs strings exceeding console buffer limits.
  • Kernel panic - not syncing: VFS: Unable to mount root fs encodes the exact failure stage: unknown-block(0,0) indicates missing/truncated root= or CONFIG_ROOT_NFS, whereas mmcblk error -2 without rootwait indicates asynchronous USDHC probe race.
Progress is saved on this device.
up next · module 5 labLab: i.MX6ULL Boot-Strap Decoder, AAPCS32/.bss Guard & VFS Panic Triage Engine (60 min)
→ module 5 lab

search — fzf

0/0 ───────────────────────────────────────────

keyboard shortcuts — less

/
search
f
focus mode
[
previous
]
next
?
help
Esc
close

figure