Fixed task_dispatch_hook so it matches the changes on the 1300D and 6D. I couldn't follow the comments on the task_dispatch_hook for those cameras but I used my best pattern matching skills and also checked against the 100D and 70D so I'm pretty confident that I've got this right.
Looks right to me.
The comments are still valid; for example the 1300D one:
// task_trampoline -> last call -> last non-empty BL -> one indirect call here
task_trampoline (0xFFD2A1D8 - RAM_OFFSET) -> 0xC9F4.
Last call: B sub_C8FC
Last non-empty BL: sub_C8FC ends at C9F0, the BL at C9E8 calls an empty function, the one before it calls sub_1D7C.
One indirect call here:
1D88 LDR R0, =0x8FBE0
1D90 LDR R3, [R0]
1D94 CMP R3, #0
1DA4 BLXNE R3
Answer: 0x8FBE0.
The comments from 6D are easier to follow with a decompiler, but they follow the same logic.
By the way, the EOSM doesn't fall into the same pattern as the other cameras. Is new-dryos-task-hooks working properly on the EOSM?
From what I could tell in QEMU, it works fine. If ML is still working on the camera with new-dryos-task-hooks (or lua_fix, which includes the former), then it works fine.
The EOSM uses old-style task hooks (that's a property of Canon code, we can't change it); our debug messages are still printed with the new-dryos-task-hooks branch (on the old-style code path; they look slightly different). The point of that PR is to have a unified codebase that covers both old-style and new-style cameras.
However, as you can see from my comment it no longer works on the camera. LED turns on and camera won't boot up.
That's odd, as with your vanilla code, it boots fine in QEMU. Just in case: you haven't run the binary compiled with CONFIG_QEMU=y on the camera by mistake, right? (that would result in lock-up)
You still have to enable the new-style DryOS hooks; noticed that was a bit non-intuitive, so I've just refactored it to use CONFIG_NEW_DRYOS_TASK_HOOKS in internals.h. Previously, you had to comment out HIJACK_TASK_ADDR to enable the new hooks. Not enabling the new-style hooks should not result in camera lock-up.
Side note: confirmed the new DryOS hooks, in their current shape, are also compatible with DIGIC 6 (tested on 80D) and from what I could tell without trying, also with DIGIC 7 (not tested, but the task hook call looks very similar).
Now how to get the console to show button events? I'll bet the answer is to get the task hooks working properly.
Right.