Can SDM and CHDK be on the same SDHC card In-Camera - page 2 - General Help and Assistance on using CHDK stable releases - CHDK Forum

Can SDM and CHDK be on the same SDHC card In-Camera

  • 66 Replies
  • 14854 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #10 on: 15 / February / 2009, 11:54:39 »
Advertisements
we could only switch to sdm, not back, as sdm doesnt have lua.

Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #11 on: 16 / February / 2009, 07:40:04 »
Two builds coexisting on the same card is sort of possible

Well, the CFG files are named differently, no need to have separate folders for scripts, maybe a menu option could simply change DISKBOOT.BIN name  for next reboot ?

DISKBOOT.BIN -> DISKBOOT.BIT   (current build)
DISKBOOT.BI  ->  DISKBOOT.BIN  (alternative build on reboot)
DISKBOOT.BIT -> DISKBOOT.BI   

Anyone tried changing filenames, does it work  ?

I didn't want to wait for shipping from Adorama so I went shopping at Best Buy for a Sandisk Ultra II 8GB card.  $49.  WOW! 

So I figured I'd tough it out and get another from Adorama anyway:  $25.

Then I slept on it and changed my mind.

I now have both CHDK and SDM on both of my cameras.  I just change the name of all of the respective files.

I wrote down install instructions.  Here they are in clear rough draft.  I hope newbs like me like them. 

A570IS 101a

using sdminste.exe to install SDM

New Install
Choose Right / Left Camera and 8GB

Quick Format

SDMRight1
SDMRight2

SDMLeft1
SDMLeft2

The installer will automatically load the card.

Switch to Write-Protected / Locked

Done

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After SDM is loaded here is what is on the SDHC:

partition 1:  DISKBOOT.BIN file

partition 2:  CHDK folder and DCIM folder

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The idea is to load CHDK firmware along with SDM on both cameras.  They can be run from the same card by changing the names of the files / folders depending on usage.

Using the sdminste.exe program, swap the partitions to get to partition 2.  Then add the prefix to the appropriate folders:  either SDM_ or CHDK_ to deactivate them.  Remove these prefixes to activate them.

Always keep both cameras loaded / activated with SDM when not in use.

With SDM:  The cameras can be turned on in either Play or Record mode.  Remember:  card is locked.

With CHDk:  The camera must be turned on in Play mode to use the Firmware Update load method.  Remember:  card is unlocked.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After CHDK is loaded here is what is on the SDHC:

partition 1:  DISKBOOT.BIN file, PS.FIR file, UpgradeLog.txt file

partition 2:  CHDK folder and DCIM folder

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When the card has both CHDK and SDM installed here is what is on the SDHC:

with CHDK active:

partition 1:  DISKBOOT.BIN file, PS.FIR file, UpgradeLog.txt file, and SDM_DISKBOOT.BIN file
partition 2:  CHDK folder, DCIM folder, SDM_CHDK folder, and SDM_DCIM folder

with SDM active:

partition 1:  DISKBOOT.BIN file, CHDK_PS.FIR file, CHDK_UpgradeLog.txt file, and CHDK_DISKBOOT.BIN file
partition 2:  CHDK folder, DCIM folder, CHDK_CHDK folder, and CHDK_DCIM folder

Sf




« Last Edit: 16 / February / 2009, 08:19:33 by superfly »

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #12 on: 16 / February / 2009, 13:46:23 »
If reyalp's correct, DryOS doesn't hide DISKBOOT.BIN. That would mean Lua could be easily used on DryOS cameras to switch between an arbitrary number of builds (but not away from SDM as long as there is no Lua in SDM).

I only have my vxworks a570 so I can't test this.

*

Offline fe50

  • ******
  • 3099
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #13 on: 16 / February / 2009, 14:06:09 »
If reyalp's correct, DryOS doesn't hide DISKBOOT.BIN. That would mean Lua could be easily used on DryOS cameras to switch between an arbitrary number of builds (but not away from SDM as long as there is no Lua in SDM).
I only have my vxworks a570 so I can't test this.

Yes, on DryOS cameras the diskboot.bin is fully accessible and can be moved, renamed or deleted while CHDK is running,
i've just moved diskboot.bin with the filebrowser to the \DCIM folder...


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #14 on: 16 / February / 2009, 17:12:29 »
A Lua script to toggle between two builds:
http://chdk.setepontos.com/index.php/topic,3185.0.html

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #15 on: 16 / February / 2009, 17:48:31 »
If reyalp's correct, DryOS doesn't hide DISKBOOT.BIN.

VxWorks not hides diskboot.bin itself, but CHDK hides it (using iosDevAdd() function to avoid infinite booting loop). Maybe is possible to "unlock" disboot.bin after CHDK startup using iosDevDelete() function (cannot test this, now I'm without VxWorks camera).

*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #16 on: 17 / February / 2009, 15:17:27 »
Maybe it is possible to "unlock" disboot.bin after CHDK startup using iosDevDelete() function

Unhiding DISKBOOT.BIN positively confirmed in VxWorks Ixus950.

In this cam, iosDevDelete() appears to be at 0xFF929BB8 -- pure guessing, it's just between iosDevFind() and iosDevAdd(). I don't know any analytical way to find it. Anybody?!

Then, I re-write in boot.c:

static void drv_self_hide()
{
    long drvnum;
   
    drvnum = _iosDrvInstall(dh_err,dh_err,dh_err,dh_err,dh_err,dh_err,dh_err);
    if (drvnum >= 0)
   _iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum);
}
void drv_self_unhide()   // iosDevDelete
{
    ( ( void(*) (void*) ) (0xFF929BB8) ) (drv_struct);
}

(NOTE: generally, it's not a good practice to call an ARM function like that...)

And in core\main.c:

void core_spytask()
{
    int cnt = 1;
    int i=0;

    raw_need_postprocess = 0;

    spytask_can_start=0;

    while((i++<250) && !spytask_can_start) msleep(10);

    started();
    msleep(50);
    finished();

    extern void drv_self_unhide();
    drv_self_unhide();
    ...

The function templates, according to VxWorks, are: STATUS iosDevAdd(DEV_HDR * pDevHdr, char *name, int drvnum ) and void iosDevDelete(DEV_HDR * pDevHdr).

Now, I can delete or move DISKBOOT.BIN using file browser and then re-boot successfully.

« Last Edit: 17 / February / 2009, 16:05:44 by whoever »

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #17 on: 17 / February / 2009, 16:37:49 »
In this cam, iosDevDelete() appears to be at 0xFF929BB8 -- pure guessing, it's just between iosDevFind() and iosDevAdd(). I don't know any analytical way to find it. Anybody?!

However, iosDevDelete() present in IDA database for VxWorks (CanonFW_VxWorks_A-Series.sig) and can be found automatically for old VxWorks cameras just before iosDevAdd() function (example for a710):
Code: [Select]
ROM:FFEFEC78 iosDevDelete                           
ROM:FFEFEC78                 STMFD   SP!, {R11,LR}
ROM:FFEFEC7C                 MOV     R11, R0         
ROM:FFEFEC80                 BL      sub_FFEFEAC8 
ROM:FFEFEC84                 LDR     R0, =0x9F2DC
ROM:FFEFEC88                 MOV     R1, R11         
ROM:FFEFEC8C                 BL      dllRemove       
ROM:FFEFEC90                 BL      sub_FFEFEAD4 
ROM:FFEFEC94                 LDR     R0, [R11,#0xC]
ROM:FFEFEC98                 LDMFD   SP!, {R11,LR} 
ROM:FFEFEC9C                 B       free           

So, maybe we can find using CHDK signatures:
a610 1.00e (sig_ref_vxworks_1.txt): iosDevDelete 0xFFEBD054
a710 1.00a (sig_ref_vxworks_2.txt): iosDevDelete 0xFFEFEC78
a570 1.00e (sig_ref_vxworks_3.txt): iosDevDelete 0xFFCD7D30


Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #18 on: 17 / February / 2009, 17:30:47 »
A620    0xFFEC3D78


Works fine.

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Can SDM and CHDK be on the same SDHC card In-Camera
« Reply #19 on: 18 / February / 2009, 07:04:35 »
When I tried to find iosDevDelete() using CHDK signatures, it failed  :(
On gensigs.sh, sh.exe "performs illegal operation and will be closed".
This happens under Windows XP for GCC environment 3.4.6 and 4.3.2.
Previous version of gensigs.sh (before #566, without starting address of firmware) works fine.
I understand nothing. Of course, I can modify this script that it can working for me (in attachment), but...

edit: attachment is changed
« Last Edit: 18 / February / 2009, 07:34:55 by ewavr »

 

Related Topics