Author Topic: How to run Magic Lantern into QEMU?!...  (Read 55190 times)

Greg

  • Hero Member
  • *****
  • Posts: 525
Re: How to run Magic Lantern into QEMU?!...
« Reply #125 on: January 29, 2017, 09:58:38 PM »
500D with spells from 550D has a new menu item :


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9565
  • 5D Mark Free
Re: How to run Magic Lantern into QEMU?!...
« Reply #126 on: January 29, 2017, 11:03:34 PM »
Very cool. I had this setting enabled on 550D, so it must be saved on the MPU side (probably EEPROM).

Old notes about it: https://groups.google.com/d/topic/ml-devel/ti8GyVqEZmo/discussion

Greg

  • Hero Member
  • *****
  • Posts: 525
Re: How to run Magic Lantern into QEMU?!...
« Reply #127 on: January 30, 2017, 02:21:39 AM »
Yes it is stored in the MPU.
Code: [Select]
Studio mode on  { 0x06, 0x05, 0x01, 0x42, 0x01, 0x00 },
Studio mode off { 0x06, 0x05, 0x01, 0x42, 0x00, 0x00 },

Greg

  • Hero Member
  • *****
  • Posts: 525
Re: How to run Magic Lantern into QEMU?!...
« Reply #128 on: January 31, 2017, 01:01:49 AM »
500D 30MB/s  :P

Greg

  • Hero Member
  • *****
  • Posts: 525
Re: How to run Magic Lantern into QEMU?!...
« Reply #129 on: February 12, 2017, 05:59:45 PM »
GUI switch progress :



Live View :




Greg

  • Hero Member
  • *****
  • Posts: 525
Re: How to run Magic Lantern into QEMU?!...
« Reply #130 on: February 14, 2017, 09:03:32 PM »


Greg

  • Hero Member
  • *****
  • Posts: 525
Re: How to run Magic Lantern into QEMU?!...
« Reply #132 on: February 17, 2017, 04:48:58 PM »
Live View VRAM patch :



Code: [Select]
[EDMAC#18] Starting transfer to 0x1B07800 from conn #4, 1440x424, flags=0x20000080
Loading photo raw data from ./500D/VRAM/PH-LV/LV-000.422...
[EDMAC#18] 610560 bytes written to 1B07800-1B9C900.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9565
  • 5D Mark Free
Re: How to run Magic Lantern into QEMU?!...
« Reply #133 on: February 18, 2017, 11:28:54 PM »
500D menu navigation works here too, thanks Greg :D

Currently, this old camera is the only one that lets you navigate Canon menu. All other models show either a static GUI or the date/time screen.

Also committed:
- initial support for EOS M10 and M5 (for CHDK)
- an option to export function calls to IDA
- an experiment to group related MPU messages from timestamps (in the dm-spy-experiments branch)
- some auto comments regarding MPU messages
- minor fixes here and there.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9565
  • 5D Mark Free
Re: How to run Magic Lantern into QEMU?!...
« Reply #134 on: February 21, 2017, 01:46:02 AM »
Formatting the virtual card works too, both from Canon and ML (of course, on 500D) :)

This is the first test in the suite that runs an unmodified ML binary. It actually downloads the current nightly build (at the time of writing) and checks both the GUI (expected screens) and the card contents (whether ML still boots after being restored).

Test log

This log should also contain useful info (what commands to run), should you want to reproduce these experiments on your PC. I should probably write a guide, other than the tips from the install script.

Menu screens currently covered by the test suite:







There are still some nondeterministic bugs (that's why some tests are retried a few times, until sucess); those will need fixing before using QEMU as a test platform for ML builds. Still, it already starts to be useful (for example, for getting menu screenshots).

At this stage, I think the old implementation is no longer useful, so we may start thinking about merging the QEMU branch into unified. This will remove most of those CONFIG_QEMU hacks from the source code.

BTW, if you have experience with some testing framework, and you know a nicer way to implement the current tests, I'd be interested in hearing from you.

Greg

  • Hero Member
  • *****
  • Posts: 525
Re: How to run Magic Lantern into QEMU?!...
« Reply #135 on: February 26, 2017, 06:17:25 PM »
Firmware update
ROM modified with hexeditor "DisableMainFirm" - http://magiclantern.wikia.com/wiki/Bootflags
500D 1.1.1 -> 1.1.2



Code: [Select]
200:  5337.856 [UPD] Welcome to Update program
201:  5337.856 [UPD]   Program Ver.Slave 0.2.0
208:  5338.112 [UPD] ------------ Initialized
277:  5343.232 [UPD] CurrentVersion=1.1.1
278:  5343.232 [UPD] DS_MODELID =0x80000252
295:  5350.144 [MS] LOCK (1)
535:  8316.672 [UPD] StartFirmupProgress
569:  8319.232 [UPD] ERROR Do not read
571:  8358.912 [UPD] 0=UPD_VerifyFirmware
572:  8830.464 [UPD] 0=UPD_DecryptoFirmware
574:  8850.944 [UPD] CheckSum file=0xd960afec buffer=0xd960afec
575:  8947.968 [UPD] SAFEMODE
620: 35370.240 [UPD] ERR 1=updSpecificPartner


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9565
  • 5D Mark Free
Re: How to run Magic Lantern into QEMU?!...
« Reply #136 on: March 07, 2017, 04:44:59 PM »
First ML change I've tested in QEMU on all unified models:

https://bitbucket.org/hudson/magic-lantern/pull-requests/796/new-method-for-getting-current-task-names/diff

Latest update adds partial 7D support (slave CPU only, without IPC).

Test log.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 9565
  • 5D Mark Free
Re: How to run Magic Lantern into QEMU?!...
« Reply #137 on: March 24, 2017, 01:08:42 AM »
A small change that unlocked Canon menu navigation on many models:

https://bitbucket.org/hudson/magic-lantern/commits/c881ba2

After some refactoring and porting the 500D MPU messages required for GUI, Canon menu navigation is now also working on...

60D, 550D, 600D, 700D, 100D, 1100D and 1200D!

Screenshots (guess the cam):






Test log.

All screenshots here (click on Expand all).

This is a big breakthrough, as it effectively lets me review ML ports or code changes on cameras I don't own :)

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 2770
  • 5D3 / M1 / 7D / 70D / SL1
Re: How to run Magic Lantern into QEMU?!...
« Reply #138 on: March 24, 2017, 05:34:39 AM »
Holy cow, @a1ex!
5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101