@ARM assembly gurus: How can we do a "cold reboot" from CHDK ? - page 3 - General Discussion and Assistance - CHDK Forum
supplierdeeply

@ARM assembly gurus: How can we do a "cold reboot" from CHDK ?

  • 34 Replies
  • 11449 Views
*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #20 on: 11 / March / 2008, 11:29:22 »
Advertisements
@wontolla

1.  10 just meant it works consistently (for me)
2.  Reboot (off then on)
3.  Addresses are for 'Restart called' / 'RestartDevice'.
4.  Ah... that means I explained unclearly: in the function it is called, not declared.
    like this('body' of func commented out):
Code: [Select]
    void gui_draw_reversi(int arg) {
    cold_reboot();
    // if ((mode_get()&MODE_MASK) != MODE_PLAY) {
        // gui_mbox_init(LANG_MSG_INFO_TITLE, LANG_MSG_SWITCH_TO_PLAY_MODE,
        //               MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL);
        // return;
    // }
    // gui_mode = GUI_MODE_REVERSI;
    // gui_reversi_init();
    }
Sorry I should have been clearer.

BTW there's a S3IS binary in this post Have fun and utility with the camera

*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #21 on: 11 / March / 2008, 17:18:10 »
Hm, I still prefer my method a bit, although I bypass some stuff so the camera shuts down uncleanly (it probably corrupts some CHDK bits when cleaning up, so it doesn't boot properly when I run the entire restart function). That might have caused my glitches, I'm bluntly loading CHDK into memory and jumping there when it expects to find the camera in a not-yet-booted state.

Anyway, the reason I prefer my method is that you can load *any* file you want instead of being limited to the specific DISKBOOT.BIN version. This way, you could have a normal, recent CHDK build you prefer to use most often boot automatically and show you a boot-menu or at least give you the option to have a boot-menu. Then you can actually load any code you want without having to swap DISKBOOT.BIN files. This is especially useful when using older builds or builds (or even software other than CHDK) without this functionality. I'll have to do a bit more research but I think I can bypass/simulate enough stuff to cleanly shutdown the camera (if required), possibly simulate a part of the boot-up process and then jump to the loaded software. Now you won't need a computer if some software malfunctions or fails to boot, you can just restart your camera manually.
Still, I'm reasoning mainly from my point of view (which is the S5), I've had a fair amount of creative control over my build, as DryOS wasn't ported yet. I think I did do things somewhat differently, so I don't know how portable this is to other camera models.

*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #22 on: 11 / March / 2008, 17:35:58 »
@Dataghost

This is only fase 1: I want fully swappable versions as well, but first want to work out a system to cleanly do that.
There's the additional problem of having the swap routine identify builds/versions, currently it has only the version
stamped into the binary (?), don't know how to access that though.
File-wise, my current idea is a SWAP subdir in CHDK, which would contain the 'inactive' builds/versions.
That would have the advantage of keeping the card uncluttered. Open to any suggestions though, still
considering the options.

wim
 

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #23 on: 11 / March / 2008, 17:48:46 »
well, when you swap chdk, you can read out the version string of the current running chdk, then move the binary into the subdir and rename it to versionstring_PS.fir. then you could generate a table showing the user the list of *_PS.fir files residing in that directory. user chooses chdk he likes and then you copy/move that file into root, rename it to PS.FIR and reboot. something like that?


*

Offline quietschi

  • ***
  • 116
  • Ixus70 102a
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #24 on: 11 / March / 2008, 18:10:53 »

Code: [Select]
    void gui_draw_reversi(int arg) {
    cold_reboot();
    // if ((mode_get()&MODE_MASK) != MODE_PLAY) {
        // gui_mbox_init(LANG_MSG_INFO_TITLE, LANG_MSG_SWITCH_TO_PLAY_MODE,
        //               MBOX_FUNC_RESTORE|MBOX_TEXT_CENTER, NULL);
        // return;
    // }
    // gui_mode = GUI_MODE_REVERSI;
    // gui_reversi_init();
    }

Hi whim

That didn't work for me on my ixus70_sd1000, i get an assembler error. Not sure whats wrong right now.
BTW the starting address for my Primary.bin is FF810000 so i think the function "Restart called" is located at 0xFF81B74C as seen in IDA.

cheers quietschi

*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #25 on: 11 / March / 2008, 18:38:37 »
@Phox
Yeah, something like that. Except, that's not enough, I would love 1) to also have the trunk version, and preferably also a,
let's say 12 character string space, sth. like #38 - 309 - mymods, to make it more flexible.

@quietschi
I'm sure you're right, and I'm wrong, I'll correct it. (I should have stuck with my original scheme and just quote
offset from ROMBASEADDR) I guess one gets lazy while doing 40+ runs of IDA  :D
About the compiler error, I wouldn't know... Are you compiling Windows or linux ?
Pretty odd since, as you can see very little actual code was added.
I'm gonna recheck all ROMBASEADDR's, add the stubs and try to compile for all cams tomorrow.

btw, you guys saw there's fresh trunk 321 ?

thanks,

wim
« Last Edit: 11 / March / 2008, 18:44:57 by whim »

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #26 on: 12 / March / 2008, 07:08:06 »
Hello whim.

Just to report that the test you prepared for Barney's S3 didn't work on mine. But well, you already know that.
The camera shutsdown, screen, buttons etc. Except that the lens doesn't retract. I compiled my own with the same behaviour.

BTW quietschi, may be you wrote something after an "#endif" instead of before.

*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #27 on: 12 / March / 2008, 07:14:05 »
@wontolla

Sorry, addresses are still wrong - I'm working on it right now.

wim


*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #28 on: 12 / March / 2008, 12:43:11 »
Hi

Rechecked all addresses, hope everything's OK this time.

Source, 323 + cold reboot: trunk323coldrebootsource.zip - 1.04MB

S3is binary + readme: s3is-100a-323coldreboot.zip - 0.08MB

Attached: Updated list NHSTUB addresses ( v3  :D)
« Last Edit: 12 / March / 2008, 12:46:04 by whim »

*

Offline quietschi

  • ***
  • 116
  • Ixus70 102a
Re: @ARM assembly gurus: How can we do a "cold reboot" from CHDK ?
« Reply #29 on: 12 / March / 2008, 13:26:52 »
Hi whim

Tested with your trunk my ixus70 and the camera reboots.

cheers quietschi

 

Related Topics