supplierdeeply

IXUS 105 / SD1300 IS porting thread

  • 755 Replies
  • 79865 Views
*

Offline c10ud

  • ***
  • 244
IXUS 105 / SD1300 IS porting thread
« on: 08 / October / 2010, 11:37:56 »
Advertisements
Link to wiki: http://chdk.wikia.com/wiki/SD1300IS

Hello there,
today i got this camera and decided to start having fun with chdk doing a port to this platform.
I started looking into the boot process with an eye on the "new" dryos boot process basing on a480, and after some hours i've been able to achieve a "normal" boot copying the assembler code from the original firmware disasm and commenting out chdk task creation (i am new to chdk porting :)).

camera specs (mine has FIRMWARE 1.00D):
Code: [Select]
#31f4
PLATFORMID=12788
PLATFORMOS=dryos
MEMBASEADDR=0x1900
RESTARTSTART=0x50000
MEMISOSTART=0x12e9fc
ROMBASEADDR=0xFFC00000
NEED_ENCODED_DISKBOOT=4

Now i have to start looking into stubs that finsig didn't found, unfortunately i don't have IDA so i guess it will take a while before i can properly boot with spytask enabled. If someone else wanna take a look/contribute, just ask and i will upload what i did so far somewhere.

Greets
« Last Edit: 08 / October / 2010, 12:14:56 by c10ud »

*

Offline c10ud

  • ***
  • 244
Re: IXUS 105 / SD1300 IS porting thread
« Reply #1 on: 10 / October / 2010, 09:13:30 »
i got spytask running correctly without crashing the camera, however no gui is showed yet, i need to fix sub/100d/lib.c :)

*

Offline c10ud

  • ***
  • 244
Re: IXUS 105 / SD1300 IS porting thread
« Reply #2 on: 10 / October / 2010, 10:54:26 »
meanwhile, here's the loader: http://www.zshare.net/download/813624206aa0ce68/
include/camera.h (relevant parts, copied from other cameras): http://ixus105.pastebin.com/gaicf6KV
sub/100d/stubs_auto.S: http://ixus105.pastebin.com/9ZsTup5N
sub/100d/stubs_entry.S: http://ixus105.pastebin.com/Xg1bPhgU
sub/100d/stubs_entry_2.S: http://ixus105.pastebin.com/rD0dd3en
sub/100d/stubs_min.S: http://ixus105.pastebin.com/TmDtwuhJ
sub/100d/boot.c : http://ixus105.pastebin.com/NhHPgijs
sub/100d/lib.c : http://ixus105.pastebin.com/d7XU2buV

core_spytask is running correctly (well, camera doesn't crash at least) as i found some wrong stubs and corrected.
Some random questions:
- Why the camera doesn't power on if i keep my finger on the power button? It does, without this chdk build (and does in other cameras chdk)
- The (small) gui isn't showing up, am i missing something?
- the mkdirs in core_spytask seem not working (shouldn't they create those directories on boot, if not present?), however i've double-checked the stub address and it seems fine.
- i don't know how to find some lib.c values, eg:
Code: [Select]
void *vid_get_viewport_live_fb(){
    void **fb=(void **)0x2180;                               // 0x2150 or 0x2180 for SX200 TODO: find this for ixus105
and
Code: [Select]
void *vid_get_viewport_fb_d(){
        int x=(*(int*)(0x2670+0x58));                           // ffc56514:    e59f81f8        ldr     r8, [pc, #504]  ; ffc56714: (00002670)
                                                            // (0x58 at FF8594F0 for SX200) TODO: find this for ixus105
        return (void*) (x ? x : 0xFFC00000) ;
}
« Last Edit: 10 / October / 2010, 10:57:38 by c10ud »

*

Offline c10ud

  • ***
  • 244
Re: IXUS 105 / SD1300 IS porting thread
« Reply #3 on: 10 / October / 2010, 12:17:59 »
i think i can partially answer myself saying that i must implement init_file_modules_task() that should correctly start the spytask? if so, do i need the entire chain or i can stop to the first part?


Re: IXUS 105 / SD1300 IS porting thread
« Reply #4 on: 10 / October / 2010, 12:21:19 »
Hello c10ud!
I have an IXUS105 too (firmware 1.00D). I'm new here, and I'm also a rookie in CHDK porting  :D
It's very nice to see this thread created! Good work!

Unfortunately, I'm quite busy these days (I hope it will go better in a few weeks...), but I'll try to help as much as I can !

Best,
A.

*

Offline reyalp

  • ******
  • 10069
Re: IXUS 105 / SD1300 IS porting thread
« Reply #5 on: 10 / October / 2010, 15:59:41 »
i think i can partially answer myself saying that i must implement init_file_modules_task() that should correctly start the spytask? if so, do i need the entire chain or i can stop to the first part?
If you mean core_spytask_can_start, this only signals spytask that it doesn't need to way. Otherwise, it uses a hardcoded delay (although I guess this might not be long enough).

The live viewport stuff isn't essential for getting the port running, you can return null and CHDK will operate correctly.

Quote
- Why the camera doesn't power on if i keep my finger on the power button? It does, without this chdk build (and does in other cameras chdk)
I think something to do with this ?
Code: [Select]
"BL      sub_ffc24320\n"      // removed in other ports, but if i remove it, camera crashes!
[/quote]
Look inside this function, maybe some part of it still needs to be done.
Don't forget what the H stands for.

*

Offline c10ud

  • ***
  • 244
Re: IXUS 105 / SD1300 IS porting thread
« Reply #6 on: 11 / October / 2010, 11:03:43 »
Hello c10ud!
I have an IXUS105 too (firmware 1.00D). I'm new here, and I'm also a rookie in CHDK porting  :D
It's very nice to see this thread created! Good work!

Unfortunately, I'm quite busy these days (I hope it will go better in a few weeks...), but I'll try to help as much as I can !

Best,
A.
great!

i think i can partially answer myself saying that i must implement init_file_modules_task() that should correctly start the spytask? if so, do i need the entire chain or i can stop to the first part?
If you mean core_spytask_can_start, this only signals spytask that it doesn't need to way. Otherwise, it uses a hardcoded delay (although I guess this might not be long enough).

The live viewport stuff isn't essential for getting the port running, you can return null and CHDK will operate correctly.
about core_spytask_can_start: yes i've seen it's starting after a little while (or i wouldn't get something running in background, i guess :p), my bad
live viewport: i was just wondering where those values came from, anyway still ain't getting chdk logo to show, i must be missing something

Quote
- Why the camera doesn't power on if i keep my finger on the power button? It does, without this chdk build (and does in other cameras chdk)
I think something to do with this ?
Code: [Select]
"BL      sub_ffc24320\n"      // removed in other ports, but if i remove it, camera crashes!
[/quote]
Look inside this function, maybe some part of it still needs to be done.
my bad, forgot the +4 in
Code: [Select]
*(int*)(0x221c+4)= (*(int*)0xc0220024)&1 ? 0x200000 : 0x100000; // replacement for correct power-on. ffc477a0 now it works as expected:)

*

Offline reyalp

  • ******
  • 10069
Re: IXUS 105 / SD1300 IS porting thread
« Reply #7 on: 11 / October / 2010, 12:07:19 »
live viewport: i was just wondering where those values came from, anyway still ain't getting chdk logo to show, i must be missing something
The OSD (including logo) is on the bitmap buffer, not the live view. Incorrect values of the live view will not affect ability to display the OSD
Don't forget what the H stands for.


*

Offline c10ud

  • ***
  • 244
Re: IXUS 105 / SD1300 IS porting thread
« Reply #8 on: 11 / October / 2010, 12:37:30 »
live viewport: i was just wondering where those values came from, anyway still ain't getting chdk logo to show, i must be missing something
The OSD (including logo) is on the bitmap buffer, not the live view. Incorrect values of the live view will not affect ability to display the OSD
i know that, i badly written my sentence, they're actually two different ones:
- i don't know how to find those live values (__future__)
- i don't know why i am not getting the logo

meanwhile, i found this:
Code: [Select]
//ffcd60d8: e3a00e2d mov r0, #720 ; 0x2d0
//ffcd60dc: e3a010f0 mov r1, #240 ; 0xf0

long vid_get_bitmap_buffer_width() { return 720; }


long vid_get_bitmap_buffer_height() { return 240; }

i am now experimenting with draw functions in gui init code. there must be somethign wrong..

*

Offline c10ud

  • ***
  • 244
Re: IXUS 105 / SD1300 IS porting thread
« Reply #9 on: 11 / October / 2010, 13:44:00 »
actually, i found out that adding
Code: [Select]
case GUI_MODE_NONE:
         gui_draw_osd();
            draw_txt_string(20, 14, "<OSD>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG));draw_txt_string(20, 14, "<OSD>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG));
in gui_redraw.c shows correctly the string in the screen.

i'm starting to think in some bug that prevents the logo from being loaded (and mkdirs from main.c to be successful :)) i'll try to find the stubs that may fail here. (or locked sd card ?)

 

Related Topics