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
149 stars 51 forks source link

1100D build fails to boot; binary is too large #109

Closed parabelboi closed 11 months ago

parabelboi commented 1 year ago

First I'd like to thank you for the latest updates: It allowed me to successfully build, install and boot the latest dev branch on three cameras (5DII, 6D and 550D).

The image for the 1100D was building and installing fine, but unfortunately it is blinking SOS when booting.

Maybe it's worth to mention that

The screen stays black, so I have no more info than that.

I'm going to build qemu-eos and see if it's reproducible there. But since the documentation is slightly outdated it might take a bit ;-)

reticulatedpines commented 1 year ago

Hi. This sounds like it would be a better fit for Discord :) https://discord.gg/uaY8akC

I can't attempt to repro this because I don't have a 1100D rom. I would expect you can get useful info from Qemu. Build instructions for Qemu 4.2.1 should be up to date and it should build easily: https://github.com/reticulatedpines/qemu-eos/tree/qemu-eos-v4.2.1/magiclantern

If you get qemu working, create a new build like this (from 1100D platform dir): make clean && make CONFIG_QEMU=y -j16 disk_image

This build will not run on a physical cam, only in qemu. It will give more detailed logging.

Are you aware that this repo is untested on older cams? Can you explain why you're using it at all? It was started as part of the work to support modern cams. It's not intended as a replacement for official repo. There are no guarantees it will work at all.

That said, I want it to work on all cams so I'm interested in determining if this is a real problem and how to fix it.

parabelboi commented 1 year ago

Hi,

I'm currently not registered with discord. I really don't know why I should give them my email address. Maybe they have not heard about oauth2/oidc. Or maybe collecting email addresses is part of their business model? What about freenode? It's a bit quiet in there ;-)

Anyways, I got qemu (and modules) compiling successfully now. I'll continue on creating images for it the next days ;-)

Regarding my motivation: I'm more interested in getting involved into ML development. I thought fixing the latest ML for that camera might be a low-hanging fruit. I tried to identify what commit has broken it (by bisecting), but lost motivation after a few tries :-) For now I am totally happy to have cr2hdr/mlv_dump and the git-ified ML compiling with a recent toolchain (thx again for your effort).

So I'm closing this issue for now, it's really not important to me ;-) As soon as I get familiar with the tools, I hope to be able to fix this by myself (two fingers crossed).

Cheers, parabelboi

parabelboi commented 1 year ago

Yay, I got qemu running, the reason seems to be the limited memory:

magiclantern$ ./run_qemu.py 1100D --boot 2>&1|tail -n 30
ff012518: eb0055f0 => eb8cd987 fixup offset 000055f0 => -00732679
ff01251c: eb016b7c BL 00016b7c => ff06d314
ff01251c: eb016b7c => eb8def13 fixup offset 00016b7c => -007210ed
ff012520: eb016817 BL 00016817 => ff06c584
ff012520: eb016817 => eb8debae fixup offset 00016817 => -00721452
ff012524: eb018d66 BL 00018d66 => ff075ac4
ff012524: eb018d66 => eb8e10fd fixup offset 00018d66 => -0071ef03
ff012528: eb002282 BL 00002282 => ff01af38
ff012528: eb002282 => eb8ca619 fixup offset 00002282 => -007359e7
ff012544: eb01756a BL 0001756a => ff06faf4
ff012544: eb01756a => eb8df901 fixup offset 0001756a => -007206ff
ff012554: 3a206e6f B  00206e6f => ff82df18
ff012554: 3a206e6f => 3aacf206 fixup offset 00206e6f => -00530dfa
ff0125e8: 252f6425 LD 6, 15, -1061 => ff0121cb: 252f6268 616 data=34315200
ff0125f0: 3a642520 B  00642520 => 0091ba78
ff0125f0: 3a642520 => 3af0a8b7 fixup offset 00642520 => -000f5749
ff0126a8: 6b736154 BL 00736154 => 00ceac00
ff0126a8: 6b736154 => 6bffe4eb fixup offset 00736154 => -00001b15
Fixups=cf1530 entry=cf1568 free_space=38
[BOOT] changing AllocMem limits:
0x00cf1588:  e3a0160d  mov      r1, #0xd00000
0x00cf158c:  e3a0083d  mov      r0, #0x3d0000
0x00cf1588:  e3a01732  mov      r1, #0xc80000
0x00cf158c:  e3a0083d  mov      r0, #0x3d0000
[BOOT] reserved 524032 bytes for ML (used 532224)
[BOOT] out of memory.
[MPU] WARNING: forced shutdown.

For clean shutdown, please use 'Machine -> Power Down'
(or 'system_powerdown' in QEMU monitor.)
parabelboi commented 1 year ago

Just for the record: After disabling all features in platform/1100D.105/features.h the used memory was only decreased by 512 bytes. Changing CFLAGS to Os did not help either. There are still 7680 bytes missing.

reticulatedpines commented 1 year ago

Hi. I don't check github very often (part of why it's not great for these kinds of troubleshooting questions). So, I'm sorry for the slightly late response. Good to see you got Qemu working!

IRC is very inconvenient for coordination when people are in different timezones and might be connecting via different devices, etc: there is no chat history. Now everybody has to setup a bouncer, which most people won't even know is a thing, etc, etc. This and numerous other complaints make IRC bad for helping out noobs (a large function for us!), and not great even for devs.

IRC is old and annoying (v2 standard is supposed to at least fix chat history, maybe they'll ship it eventually). Discord allows easy sharing of files, images and supports formated text. These are all very useful for dev work.

The primary reason Discord want an email address is so they can reset your password if you forget it. This is very important functionality for most users. You can of course use a throwaway email address, if you're concerned about giving them one you care about.

I don't even like Discord very much, but it's much better than IRC. Give it a try!

Yes, looks like ML image for 1100D is too large for available mem. It's not obvious, but features.h doesn't control all features. The majority are in all-features.h, which features.h includes. You can undef individual features in features.h. If you remove the include entirely, the build will fail, because historically it was assumed all Digic 4 and 5 cameras shared most features, and (I assume) no testing was done with this configuration.

Locally, if I add #undef FEATURE_SHOW_FREE_MEMORY the build is small enough. I can't test this.

parabelboi commented 1 year ago

Yep, that fixed it. Now qemu runs into an assertion, but the zip installs and boots nicely on the camera. And yes, I didn't check the included all_feature.h ;-)

I guess this fix might also be needed for the 600D (did not try yet). I'll borrow one for testing the next days and report back

Alright then, I'm going to join discord ;-) Since I switched to tmux recently, I guess the time has come to evaluate a new chat-client, too (https://xkcd.com/1782/).

reticulatedpines commented 1 year ago

Great, thanks for confirming it works. Thanks for the report and test work too :)

600D works fine in Qemu here. I guess it has more available mem, build is larger.

Qemu 4 is a somewhat recent port for qemu-eos, which I did. We were on Qemu 2, and a lot of internals have changed. Additionally, I did this work because I wanted to work on supporting newer cams. Those have an MMU. This leads to an important difference in behaviour: null pointer derefs don't trigger a crash on older cams. And, in qemu 2, it was configured to simply allow access to unmapped memory. Because I was simultaneously concerned about a bad port to qemu 4 causing differences, and needing to change behaviour for MMU cams since unmapped accesses definitely do crash on phys cams there (and 0x0 is an unmapped address), I enabled an assert. Turns out our emulation of older cams relies on unmapped accesses more than I'd like. I'm not sure of the best way to resolve this generally.

Just saw you join discord - the majority of channels are hidden until you follow the instructions in Rules channel. This is a light-weight anti-spam / bot measure.

There was a brief window when Pidgin worked for everything, things were better then :(

parabelboi commented 1 year ago

Yes, I just installed the latest dev branch on the 600D without any problem.

Do you need a merge request for this one-liner? ```patch diff --git a/platform/1100D.105/features.h b/platform/1100D.105/features.h index e253d2ae5..3c98fab5e 100644 --- a/platform/1100D.105/features.h +++ b/platform/1100D.105/features.h @@ -26,3 +26,4 @@ #undef FEATURE_SHOW_GUI_EVENTS #undef FEATURE_SHOW_EDMAC_INFO #undef FEATURE_FLEXINFO +#undef FEATURE_SHOW_FREE_MEMORY ```

Regarding discord: I managed to pass the anti-spambot and also read through the scrollback of some channels. Lots of interesting stuff there. I'm glad that the project is almost back on track. Would be nice to have nightly builds based on your repo, but I'm getting a bit of-topic now.

I am currently using pidgin with purple-discord on debian bookworm. It is working for me (but maybe I should not saying it too loud). Only some minor issues with some unicode characters (e.g. the onces in your nickname, hehe) But I also did not try to use a different font so far.

reticulatedpines commented 1 year ago

No harm doing a PR for it, that way you get the credit and it's mostly your work - test work outweighed my one-line code change in effort :) It won't get merged for quite a while, I want to land the massive crop_rec changes that I've just finished and that will take a lot of user testing.

This repo is not ready for widely used builds yet, but I'm working towards that. Many people want more video features than this has, plus, there's been really very little testing on the "well supported" (by official repo) cams, as you have found out. The old automated testing system is completely unmaintained, I have a partial replacement but it needs more work to be useful.

Good to hear Pidgin still lives, maybe I should see if it meets my needs again, they definitely struggled for a while when all the protocols got ugly and proprietary. Discord has a relatively open API, probably not that hard to support. Maybe try fonts-noto-color-emoji, I have that installed and things work here.

parabelboi commented 1 year ago

🍦;-)

reticulatedpines commented 11 months ago

There were some delays!

Closed via: https://github.com/reticulatedpines/magiclantern_simplified/commit/38e0aeb21fab49ce253f95b3e9baacabf6c45e8d

Thanks for the help!