the sx20 porting thread - page 10 - General Discussion and Assistance - CHDK Forum

the sx20 porting thread

  • 1286 Replies
  • 460657 Views
*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #90 on: 22 / October / 2009, 20:34:03 »
Advertisements
I finished the whole boot.c. I also got E31.

Good news!!!

This was in ps.fi2 method. Now i tried with BOOTDISK.BIN, and my camera started successfully. :)

Anyway this means, that i have problems with ps.fi2 creation. I use "fi2encdec.exe -e -sys g10 my.map ps.fi2" with a non-encoded diskboot.bin.

my.map:

; header
HDR 0x000031E4 0x02230000 0x01000000 0x00000000 0x00000001
; data blocks
0x00000000 diskboot.bin boot

I'll try to compile with OPT_FI2, but i need to figure out the needed fi2.inc keys. (later on)

Now i'll try to create taskhooks. :)

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #91 on: 22 / October / 2009, 21:21:43 »
Ok, that's good news then. probably not an issue with the header thing, since the firmware did indeed run, otherwise it wouldn't run at all..
Now, don't create any hooks except for the spy task. The other hooks are hard to debug until you are able to display stuff on screen.
After you create the spytask, put a blinking at the beginning of core_spytask to make sure you get there.
If/when you get there, you will have to find the stubs. Some things need to be changed in the core, liek the structure for stat() and the wrapper for open() and stuff.

Speaking of which, would be nice if someone can test my SD980 core modifications and commit them to the SVN..

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #92 on: 23 / October / 2009, 04:50:48 »
Ok, that's good news then. probably not an issue with the header thing, since the firmware did indeed run, otherwise it wouldn't run at all..
Yes, that is curious.
Quote
Now, don't create any hooks except for the spy task. The other hooks are hard to debug until you are able to display stuff on screen.
After you create the spytask, put a blinking at the beginning of core_spytask to make sure you get there.
I get there. :)
Quote
If/when you get there, you will have to find the stubs. Some things need to be changed in the core, liek the structure for stat() and the wrapper for open() and stuff.
The camera crashes 4 second after power on. It crashes after "mkdir("A/CHDK");", but i got the mkdir function signature 100%.
BTW, do you say, that you have modifications in the core, whick eliminatates this issue? Could you pls include to your vip sd980 source?

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #93 on: 23 / October / 2009, 05:05:17 »
The modifications are here:
http://chdk.setepontos.com/index.php/topic,4403.0.html

You will also have to ifdef some LUA stuff, you'll get some error messages.

Anyway, are you sure it crashes AFTER the first mkdir? Not before?
You can comment those mkdirs anyway, they are not really needed, until you get further. Oh, and does your mkdir look the same as mine?
If so, put a mkdir at the beginning of the main code, and make a new dir that doesn't exist, then check to se if it was created. It COULD be that you didn't get the SD lock flag right, and the camera might [admin: avoid swearing please] about trying to create a dir on a R/O card.


*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #94 on: 23 / October / 2009, 05:41:35 »
The modifications are here:
http://chdk.setepontos.com/index.php/topic,4403.0.html
Thanx!
Quote
Anyway, are you sure it crashes AFTER the first mkdir? Not before?
Oh, yes, it crashes before. It was my mistake. When the camera crashes it produces nealry the same blink effect as my debug, and i beleive this was my blink debug. :) Now i modified my blink debug, it is totally unique now. :)

So, the camera crashes in the conf_restore(). I see, there are open functions also, so next i make the modifications you linked.
Quote
You can comment those mkdirs anyway, they are not really needed, until you get further. Oh, and does your mkdir look the same as mine?
Yes, our mkdir functions looks absolutely the same. Don't forget, that i get mkdir signatured 100%, with Reyalp new detecting method.
Quote
If so, put a mkdir at the beginning of the main code, and make a new dir that doesn't exist, then check to se if it was created. It COULD be that you didn't get the SD lock flag right, and the camera might [admin: avoid swearing please] about trying to create a dir on a R/O card.
This is a little point what i don't understand at all. Greenhorn question: With diskboot.bin method the camera only boots when the sd card locked, so how can anyone use chdk on a locked card?

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #95 on: 23 / October / 2009, 05:47:55 »
You set a flag that tricks the camera into thinking it is unlocked. The lock is software only.
Anyway, conf_restore() has a lot of functions in it, you'll have some fun making it work :D of course, you have it easier now with the new signatures, but there might be still unfound functions, so look for them.

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #96 on: 23 / October / 2009, 06:06:27 »
So, the camera crashes in the conf_restore(). I see, there are open functions also, so next i make the modifications you linked.

I made your linked modifications, but the camera crashes on this line in the conf_restore():

    if( stat(CONF_FILE,&st) != 0 || st.st_size < sizeof(int))
        return;

I added this line to my platform/sx20/sub/100f/makefile.inc:

CAM_DRYOS_2_3_R39=1

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #97 on: 23 / October / 2009, 06:35:23 »
I added this line to my platform/sx20/sub/100f/makefile.inc:

CAM_DRYOS_2_3_R39=1
It was wrong idea. Now i added this line to include/camera.h:

    #define CAM_DRYOS_2_3_R39           1

To the sx20 section.

I still get camera crashed at the stat function..


*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #98 on: 23 / October / 2009, 07:23:32 »
I still get camera crashed at the stat function..
No, i was wrong again. I need to sleep now a bit. :)

It crashes in the conf_load_defaults(), and no other. So commenting this function out, the camera not crashes anymore.

Now i playing with find the conf item which couse the problem.

Code: [Select]
for (i=0; i<CONF_NUM ; ++i) {
Changed to:
Code: [Select]
for (i=0; i<CONF_NUM / 2; ++i) {
Still works, and i get some orange lines on the screen...

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #99 on: 23 / October / 2009, 08:11:57 »
Now i playing with find the conf item which couse the problem.
Non of the items couse problems but if the "for" cicles more than 187 rounds, it crashes. Curious.

Code: [Select]
void conf_load_defaults() {
    register int i;

    for (i=0; i<CONF_NUM ; ++i) {
        switch (conf_info[i].type) {
            case CONF_DEF_VALUE:
                memcpy(conf_info[i].var, &(conf_info[i].i), conf_info[i].size);
                break;
            case CONF_DEF_PTR:
                memcpy(conf_info[i].var, conf_info[i].ptr, conf_info[i].size);
                break;
        }
        if (conf_info[i].func) {
            conf_info[i].func();
        }
    }
}

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal