reticulatedpines / magiclantern_simplified

A Git based version of Magic Lantern, for those unwilling or unable to work using Mercurial. The vast majority of branches have been removed, with those thought to be important brought in individually and merged.
GNU General Public License v2.0
142 stars 50 forks source link

Why does alternate 7D2 create_init_task addr trigger hang during boot? #88

Closed reticulatedpines closed 1 year ago

reticulatedpines commented 1 year ago

On 7D2, during early boot, I was getting hangs from cam. Blink debugging located this as after the call to reloc_entry() in copy_and_restart(). Swapping the following stubs swaps whether it hangs, 80000f78 works okay:

37 //ARM32_FN(0xfe6510d0, create_init_task) // unthunked Thumb at 80000f78 38 THUMB_FN(0x80000f78, create_init_task)

Bugs this early in boot process are somewhat concerning. One candidate from the cause is patch_thumb_instruction(). Possibly bad implementation for encoding some addresses? Maybe something to do with allowable range of branch?

Because 7D2 doesn't emulate this far, I can't check how it's being encoded.

reticulatedpines commented 1 year ago

I had missed putting -mthumb in Makefile.platform.default and this broke the logic. When this is added it works with either address.

Fix: https://github.com/reticulatedpines/magiclantern_simplified/commit/da1d4ddf281e57ea31383378b0de0836df2e3994