ELPH 340 (IXUS 265) - page 2 - DryOS Development - CHDK Forum  

ELPH 340 (IXUS 265)

  • 100 Replies
  • 47143 Views
Re: ELPH 340 (IXUS 265)
« Reply #10 on: 17 / June / 2014, 01:07:13 »
Advertisements
1/ Is the Pid/Vid value known for the Ixus265_elph340.
PLATFORMID = 12937 (0x3289)

Is this correct, see MakeFile-inc.png

Edit #1

Since I now have a searchable "Strings Ixus265-100a.txt" data_base
Is there some stuff that is better found by manual methods.

Edit #2

Attempt after the Hexedit,   see attached error.log

H-H
« Last Edit: 17 / June / 2014, 03:19:54 by Hardware_Hacker »

*

Offline srsa_4c

  • ******
  • 4149
Re: ELPH 340 (IXUS 265)
« Reply #11 on: 17 / June / 2014, 14:44:28 »
Attempt after the Hexedit,   see attached error.log
The correct dump starts with these bytes:
Code: [Select]
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  01 00 00 EA A4 05 9F E5 0E F0 A0 E1 03 11 A0 E3  ...ę¤.źĺ.đ á.. ă
00000010  9C 25 9F E5 D0 20 81 E5 98 25 9F E5 EC 20 81 E5  ś%źĺĐ .ĺ.%źĺě .ĺ
You can download the whole 16MB dump from http://ul.to/un00588u (link is from here: http://forum.chdk-treff.de/viewtopic.php?f=16&t=3310#p29239 ), then erase the first 64kB from it. The new start address is 0xff010000, the dump will now start with the bootloader, and the sigfinder will accept it.
Tried this and it worked.
PLATFORMOSVER only contains the number part of the DryOS revision.

Re: ELPH 340 (IXUS 265)
« Reply #12 on: 17 / June / 2014, 19:04:42 »
Attempt after the Hexedit,   see attached error.log
The correct dump starts with these bytes:

Post #11 comparison is in    DumpF_Edited.png

The DumpF is compared to the Original 100a Download in    DumpF_Compared.png

H-H
« Last Edit: 17 / June / 2014, 19:08:42 by Hardware_Hacker »

Re: ELPH 340 (IXUS 265)
« Reply #13 on: 19 / June / 2014, 18:39:39 »
I think that the:-

CHDK Code_Gen ....
3    *      automate generation of boot.c, capt_seq.c and movie_rec.c source files for CHDK
4    *      based on chdk-dasm.c from CHDK-PT, created by waterwingz, with extensions from finsig_dryos.c

is not configured correctly.

So if I delete the data content of the stubs_*.S files it  is "/* THIS FILE IS GENERATED */" but with
the original data content i.e no valid offsets.

Should I just continue to find the valid offsets manually.

Also see the attached files re the ROM Dump, ..... ????

Edit #1 I am hoping that the ROM Dump has a error above the CHDK valid offsets.

The bottom of the ROM Dump looks OK ????

H-H

« Last Edit: 19 / June / 2014, 19:22:13 by Hardware_Hacker »


*

Offline srsa_4c

  • ******
  • 4149
Re: ELPH 340 (IXUS 265)
« Reply #14 on: 20 / June / 2014, 15:00:05 »
I'll try again, hopefully the message goes through this time.
- Start with DUMPF.BIN. This binary was dumped from address 0xff000000. You need to create a binary that starts at 0xff010000, therefore you need to remove the first 0x10000 bytes from DUMPF.BIN. You should end up with a file that's 0xff0000 bytes long and starts with the bytes I showed you earlier. Once you have the file, rename it to PRIMARY.BIN .
- Hex-comparing firmware dumps from completely different models will lead to nothing. A disassembly of the dump(s) is much more useful, you can find utilities here: http://chdk.wikia.com/wiki/GPL_Tools or use IDA if you have access to it.
- You don't necessarily need to use code_gen, you can just use the generated source files. code_gen uses its own script files named code_gen.txt
- With this level of experience, you'll need access to the camera you're trying to port CHDK to.

Re: ELPH 340 (IXUS 265)
« Reply #15 on: 07 / July / 2014, 20:06:39 »
Ixus 265 Porting Progress Report #1.

General Porting Progress:-

* Porting Method for valid offsets; Dual ArmU Disassemblers vs Ref Camera .../sub/*.c and Camera under Port [CUP] .../sub/*.c.
* Now have 2 Ixus 265-100a Cameras. [ACID]
* Now using; DumpF_Edited as Primary.bin [Ixus 265-100a]
* Now using; BUILD_NUMBER := 1.3496.0 [version.inc]
* Now using; #define CHDK_BUILD_NUM 359600 [module_exportlist.h]
* Now Using; Sx 510-101a as the Reference Camera [90%++ Offset Match success rate]
* Now Using; Ixus 255-100h as another Reference Camera [~~80% Offset Match success rate]
* Up Dated some easy stuff. [Re; 1.3496.0]

My, Ixus 265-100a, Porting Progress Re;-

* Fixed about 50 Porting Typo Errors.
* Found a few possible Errors in the Reference Cameras. [Ixus 255-100h, and Sx 510-101a, and Others]
* Boot.c, Done, No Compile Errors [?]
* Filewrite.c, Done, 1 Compile Errors  [undefined reference]
* Capt_seq.c, 90% Done, Muliple Compile Errors [Muliple Offset Match Errors]

Attached; The Compile Logs.

Ixus 265-100a Porting Hosting, Comments, Ideas, ???, any one.

H-H

Continued #16, Attached [Porting Source Code]
« Last Edit: 10 / July / 2014, 00:37:19 by Hardware_Hacker »

Re: ELPH 340 (IXUS 265)
« Reply #16 on: 07 / July / 2014, 20:09:00 »
Continued from #15,

Edit #1 Deleted Attached Ixus265-100a.rar

Porting Source Code, version 2, Now see post #19

H-H
« Last Edit: 10 / July / 2014, 00:54:14 by Hardware_Hacker »

*

Offline srsa_4c

  • ******
  • 4149
Re: ELPH 340 (IXUS 265)
« Reply #17 on: 08 / July / 2014, 17:56:44 »
Code: [Select]
//** boot @ 0xFF01000C - 0xFF01017C, length=?? // 100a H-HNo, this should be the start of the main firmware, 0xff02000c. Even if it's a typo, it will get confusing later. Please do not fix up code from another camera, you should copy the equivalent code from the ixus265 firmware then change it where it needs to be changed. You can get nice formatted assembly code by using CHDK-PT, just don't forget to use the right start address after loading the ixus265 fw dump.
After you re-do all port-specific *.c files and get errors like
Code: [Select]
capt_seq.c:(.text+0x3b0): undefined reference to `loc_FF206A94'
../platform/Ixus265_elph340hs/sub/100a/libplatformsub.a(capt_seq.o): In function `loc_FF206BCC':
, erase stubs_auto.S .
The sigfinder doesn't find every needed firmware address, you need to find stuff like
Code: [Select]
lib.c:(.text+0x88): undefined reference to `viewport_buffers'
lib.c:(.text+0x90): undefined reference to `active_viewport_buffer'
viewport_buffers etc. yourself, based on another camera's firmware (the addresses are either in stubs_entry.S or in stubs_min.S).
You don't need all task replacements at the start of porting, you can comment those replacement blocks out until you're done with that part of the source, for example:
capt_seq_task and exp_drv_task in capt_seq.c not done:
Code: [Select]
#if 0
/*** INSTALL capt_seq_task() hook ***/
"    LDR     R0, =task_CaptSeq\n"       // DryOS original code function ptr.
"    CMP     R0, R3\n"                  // is the given taskptr equal to our searched function?
"    LDREQ   R3, =capt_seq_task\n"      // if so replace with our task function base ptr.
"    BEQ     exitHook\n"                // below compares not necessary if this check has found something.

/*** INSTALL exp_drv_task() hook ***/
/*"    LDR     R0, =task_ExpDrv\n"
"    CMP     R0, R3\n"
"    LDREQ   R3, =exp_drv_task\n"
"    BEQ     exitHook\n"
#endif
You may also need to remove #define's in platform_camera.h in some cases when you do this.


Re: ELPH 340 (IXUS 265)
« Reply #18 on: 09 / July / 2014, 00:02:47 »
Please do not fix up code from another camera, you should copy the equivalent code from the ixus265 firmware then change it where it needs to be changed. You can get nice formatted assembly code by using CHDK-PT, just don't forget to use the right start address after loading the ixus265 fw dump.
I'd highly recommend using code_gen to make the C task files.  Sure, it's a bit of additional work to learn the simple scripting language but the final product is going to be vastly superior.  Even philmoz found bugs in his early ports once he use code_gen to recreate the task files.
http://chdk.setepontos.com/index.php?topic=10098.0
And the minute a second firmware version needs to be ported, you will be really glad you took the trouble to port the first version that way.

Detailed documentation in the comments at the top of this file  : http://trac.assembla.com/chdk/browser/trunk/tools/code_gen.c
Ported :   A1200    SD940   G10    Powershot N    G16

Re: ELPH 340 (IXUS 265)
« Reply #19 on: 10 / July / 2014, 00:42:33 »
Ixus 265 Porting Progress Report #2.

General Porting Progress:-

* Up Dated some more easy stuff. [Re; 1.3496.0]
* To Do, stuff in Post's #17 and #18

Ixus 265-100a, Porting Progress

Version #2 and Log Attached

I am still struggling with the errors and to shut-up the compiler.

H-H

« Last Edit: 11 / November / 2014, 18:12:32 by Hardware_Hacker »

 

Related Topics