From ac6167e4e4485e9775d74a475c5328dfa4e21eee Mon Sep 17 00:00:00 2001 From: vhaudiquet Date: Sun, 30 Aug 2026 10:12:07 +0200 Subject: [PATCH] Round 14: 4K-align U-Boot entry inside the wrapped Image (start.S wfi hang) --- RESEARCH.md | 17 +++++++++++++++++ build-uboot-payload.sh | 13 +++++++++---- krane-uboot-payload.bin | Bin 589824 -> 593920 bytes krane-uboot.bin | Bin 449516 -> 453432 bytes 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/RESEARCH.md b/RESEARCH.md index 2995847..25ef674 100644 --- a/RESEARCH.md +++ b/RESEARCH.md @@ -608,3 +608,20 @@ post-relocation one): Read: last paint reached = code survived through that checkpoint; the crash/hang is in the next window. Success = banner on black. + +## Round 14 — all green decoded: U-Boot's 4K-alignment requirement + +Reboot with `fc48d83b…`: **all green, no bands** — U-Boot hung before +`board_early_init_f`. Root cause found in start.S: with +CONFIG_POSITION_INDEPENDENT, U-Boot verifies `adr _start` & 0xfff == 0 +(it uses ADRP+ADD with lo12 relocations during the PIE fixup) and +otherwise loops in `wfi` forever — a silent hang, no exception. Our +wrapper pushed U-Boot's entry to load_base+0xB4: misaligned by +construction. + +### Fix (payload `faee130f…`) + +`build-uboot-payload.sh` now pads the wrapper so U-Boot starts at the +next 4 KiB boundary (0x1000) inside the 2 MiB-aligned image; wrapper +tail branch patched accordingly (0x140003d4 → 0x1000, verified by +disassembly). Keep this invariant for every future layout change. diff --git a/build-uboot-payload.sh b/build-uboot-payload.sh index 43bcbc0..e11493f 100755 --- a/build-uboot-payload.sh +++ b/build-uboot-payload.sh @@ -40,8 +40,12 @@ hdr = bytearray(64) hdr[0:4] = struct.pack('> 2) | 0x14000000) # code0: b +0x40 struct.pack_into('3%aocAUs4z6>G&Hy5eU#?ayq`v^PhfviqnHOWc9~=4;NE6UZD;@ULtS?r&TBP+ zv|OLC+SFY;-rQX{(Fu)S+B}L*-|C)xNND}lvt)4{Q>&>YV6~YO9_0n%NobT=QkMC2 zqrQAs`EfJ!Y>@im6g{c%5-yb$#l$Bp`kLMR<0h)yTN$_=!{{#Yjd_2(TMk*k-)w*I z|CW+0zg2sves-4}!(mxz(#>2k?|+8473!oJ?6qu)obd5-9r(+^&3CxU+~Q5R_F!uk z0J+l-nqAVi#v;C`F=><`<_^)>@bCS59_o3{w?`rPKp1CJf% z0Rrndmy7`cJd;2N2$#?S0dNG=0{|4WF$YW!heQGaheQGbheQGcheQGdheQGeheQGf cw?qO5P}>BYtx0^hnB50x@{>RZw5HGqFzbId^#A|> delta 676 zcmV;V0$crnpd^5RB(U)W8SobX0000001yBG00000EC2ui0000000EbfCk7akKnDtc zv6jBl$Bq8jLNC*sJs}hz^#fEWl-#!!qct|}6Al3)Zma9&AWY6twv~>a=qRX5fINiZ zSOES!eQ7lLwdQt9ojs&b^R1n>IFVA_=?)SNPfmRzUS8LOK;o-<;S*TKKlSI;P=}55 z%mu$f9|4j?H-Wgvu`TA2fFoIJz;7ylQ90{GIF8p4FJXy##!4zkjRD_=$5lag>8mTu z)Xs-RK9B&4gR8cG`rKcY%Edf7n+CO&r(po8H zK5cL#*|8xY1@@>2POOA9)Zy@91m=ec(q;Gi24>u!{b~b*JanZtq^3MeNv{=O({^ng z2uddvK_{%!L_FDG+;UU*dVfxE~;036BFGX1J_z0 zEH4T}UB~{rJ;E7Ko-|P>*IY~aPwg2hcTgxFWC_7gzsbhMx!w~QU0=UfB zh6LfUjT7C0QQZ%eBOxQgi>n$|kWj!XC1(D}Pnh;F?FYdhr*L{i3voQzH z_>({f1(X2>3eV~Q001}u2hVJk5CIkf&or0eHU$@zKLHN{u%0XhK!+w7N&0RcP& zK~ha*m&^eHbOZqa02GIi5dnvg5dw#h5d(*i5d?>j5e0{k5eB!A5eHD)1T94Hgtz4E K2Wax9;0Q3K(jy%J diff --git a/krane-uboot.bin b/krane-uboot.bin index a5a061a097ff46f3a71221a9d1dae663a1b7c59e..008f2dd044f25d5a6318321ba2d2a451fb96aa3b 100644 GIT binary patch delta 47 zcmV+~0MP&Jw;Qzg|q{Ov;>8;1+}yW FINRV~6W{;< delta 43 zcmdmSP5RAt=?NArjzPXD6KzUZ7#SEungrSe7~2Gx+60)}1X$VxShoqVS=