SD 4000 IS / IXUS 300 HS / IXY 30S porting thread - page 3 - DryOS Development - CHDK Forum supplierdeeply

SD 4000 IS / IXUS 300 HS / IXY 30S porting thread

  • 322 Replies
  • 165889 Views
*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #20 on: 26 / August / 2010, 15:12:15 »
Advertisements
thanks for this hint. i've a feeling it is indeed related to some wrong stubs. Currently i'm checking:
Code: [Select]
//NHSTUB(strcat, 0xff813f5c)                         // WRONG
NHSTUB(strcat, 0xFF8AC1AC)                           // OK
//NHSTUB(strchr, 0xff813fe4)                         // OK
//NHSTUB(strcmp, 0xff820628)                         // OK
//NHSTUB(strcpy, 0xff820610)                         // OK
//NHSTUB(strftime, 0xff8ac3f8)
//NHSTUB(strlen, 0xff814030)                         // OK
//NHSTUB(strncmp, 0xff813f98)
//NHSTUB(strncpy, 0xff813f5c)
//NHSTUB(strrchr, 0xff83fac0)
and some more stubs i could not locate yet.

*

Offline reyalp

  • ******
  • 13882
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #21 on: 26 / August / 2010, 16:41:43 »
what usefull info can you get from romlog.txt ?
It depents on your problem. But you can get a ruff idea where its coming from. Look at here for example.
The stack trace can be quite useful. ROM addresses can be looked up in IDA, CHDK addresses can be looked up in the core/main.dump corresponding to the build you are running. If you put up test builds for other people, you can save off the main.dump so you can get something useful out of their stack traces.
Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #22 on: 26 / August / 2010, 17:51:08 »
pixeldoc2000,

I narrowed the error for now for file access
in load_bad_pixels_list
fd = open(filename, O_RDONLY, 0777);

In sx210:
NHSTUB(open, 0xff836be4)

Also in sx210 Maybe there is something in the last sub_FF872D84_my()  function, in the DataGhost's FAT32 autodetection code

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #23 on: 26 / August / 2010, 18:16:23 »
what usefull info can you get from romlog.txt ?
It depents on your problem. But you can get a ruff idea where its coming from. Look at here for example.
The stack trace can be quite useful. ROM addresses can be looked up in IDA, CHDK addresses can be looked up in the core/main.dump corresponding to the build you are running. If you put up test builds for other people, you can save off the main.dump so you can get something useful out of their stack traces.
Thanks for this hind!
I didn't even know about main.bin because of always doing "make clean" after build from script (very interesing!).
But this leads to an bunch of new qustions... I'll make a new thread about ROMLOG, because i think this could be interesting for a lot of people.

I narrowed the error for now for file access
in load_bad_pixels_list
fd = open(filename, O_RDONLY, 0777);

In sx210:
NHSTUB(open, 0xff836be4)

Also in sx210 Maybe there is something in the last sub_FF872D84_my()  function, in the DataGhost's FAT32 autodetection code
Thanks, i'll check my NHSTUB(open, 0xXXXXXXXX).
BTW, have you tried to created a romlog and looked at core/main.bin? Maybe this will help you...

EDIT: @reyalp i was talking about main.dump too!
« Last Edit: 27 / August / 2010, 01:45:31 by pixeldoc2000 »


*

Offline reyalp

  • ******
  • 13882
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #24 on: 26 / August / 2010, 19:14:50 »
I was talking about main.dump (disassembly of main.bin), not main.bin itself

I guess you could load main.bin into IDA, or a camera RAM dump.

There is also loader/<camera>/main.dump if you want to look at the loader disassembly for some reason.

Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #25 on: 27 / August / 2010, 01:12:16 »
Hi Pixledoc2000,
I finally get past  gui_init();,
you need to find the right address for open, close, read and write,  
so I think I'm getting data in an out of the cammera so looks good.

Now for the final part of core_spytask()  , the call to conf_restore(); in conf.c

I think I have a problem now with memcpy-> solved with the rignt address,

but fails here at conf_load_defaults()


« Last Edit: 27 / August / 2010, 02:12:01 by asm1989 »

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #26 on: 27 / August / 2010, 02:03:08 »
I've made some progress...

I've tried to adapt boot.c from A720, but now using SD990 and almost completly adapted boot.c. SD990 firmware and feature look almost identical to SD4000 besides some minor differents.

The Camera does start chdk via firmware update (diskboot does not start chdk, looks like camera ignores diskboot.bin for some strange reason). After camera starts, i can see something which looks like a distored "simple chdk" logo and camera does crash (but does not write romlog).
SpyTask() and init_file_modules_task() is enabled, CreateTask_PhySw() and the rest is disabled. Also FAT32 code is not implemented yet to keep it simple.

I was talking about main.dump (disassembly of main.bin), not main.bin itself
Sorry, i was talking about main.dump too!
main.dump is very helpfull, it save a lot of time by not having to disassemle diskboot.bin (main.bin).

I finally get past  gui_init();,
you need to find the right address for open, close, read and write,  
so I think I'm getting data in an out of the cammera so looks good.
I've checked all my stubs as far as possible...
Have you tested romlog or did you look at main.dump i like suggested before? It helped me to get past some problems so far...

Did anybody look at my source (github)? I've tried to add comments wherever i could. If for some reason you don't like GIT (is it even possible?) you can download source as compressed file.

I would recommend any developer to use something like local git repository or github for example. My local repro works fine against chdk SVN, github and my notebook. After some time, you don't wanna live without it (specially for things like chdk).
« Last Edit: 27 / August / 2010, 02:31:53 by pixeldoc2000 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #27 on: 27 / August / 2010, 04:01:01 »
Good new pixeldoc2000 ,

I also get something print out in the screen, buy still have some funcs to resolve,

yes I have checked your source too.


*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #28 on: 27 / August / 2010, 11:13:56 »
Hi Pixeldoc, I'm at the same point , but I dont see the logo, just the info printed about version info,
but for now crashes

I isolated it at here:

CONF_INFO(183, conf.menu_symbol_rbf_file,   CONF_DEF_PTR,   ptr:"A/CHDK/SYMBOLS/icon_10.rbf", conf_change_menu_symbol_rbf_file),

It is part of conf_load_defaults();

Other thing:

Looking at your code for example NHSTUB(openfastdir, 0xFFA95CB8)   , points to a loc , not to a function is it right?

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: SD 4000 IS / IXUS 300 HS / IXY 30S porting thread
« Reply #29 on: 27 / August / 2010, 13:06:19 »
I isolated it at here:

CONF_INFO(183, conf.menu_symbol_rbf_file,   CONF_DEF_PTR,   ptr:"A/CHDK/SYMBOLS/icon_10.rbf", conf_change_menu_symbol_rbf_file),

It is part of conf_load_defaults();
Just a thought... did you compile a "firzipsubcomplete" an put all the files on your SD-Card?
Have you check the filesystem or format the SD-Card at sometime? If a chdk config files exist, maybe delete it.
I've had the problem yesterday with it filesystem and it helped me (camera did crash without any reason).

Looking at your code for example NHSTUB(openfastdir, 0xFFA95CB8)   , points to a loc , not to a function is it right?
Code: [Select]
ROM:FFA95CB8 OpenFastDir                             ; CODE XREF: _sub_FFA95C90__ReadFDir.c__432
ROM:FFA95CB8                 MOV     R0, #0x44
ROM:FFA95CBC                 BL      j_malloc
ROM:FFA95CC0                 MOVS    R4, R0
ROM:FFA95CC4                 MOVEQ   R1, #0x1B0
ROM:FFA95CC8                 ADREQ   R0, aReadfdir_c ; "ReadFDir.c"
ROM:FFA95CCC                 BLEQ    DebugAssert
ROM:FFA95CD0                 CMP     R5, #4
ROM:FFA95CD4                 MOV     R7, #0
ROM:FFA95CD8                 STREQ   R7, [R4,#4]
ROM:FFA95CDC                 STREQ   R7, [R4,#8]
ROM:FFA95CE0                 BEQ     loc_FFA95D04
ROM:FFA95CE4                 MOV     R0, #0x8000
ROM:FFA95CE8                 BL      AllocateUncacheableMemory
ROM:FFA95CEC                 MOV     R1, #0x8000
ROM:FFA95CF0                 CMP     R0, #0
ROM:FFA95CF4                 STMIB   R4, {R0,R1}
ROM:FFA95CF8                 LDREQ   R1, =0x1BA
ROM:FFA95CFC                 ADREQ   R0, aReadfdir_c ; "ReadFDir.c"
ROM:FFA95D00                 BLEQ    DebugAssert
No, its point to function, but i'm not 100% certain its the correct one  ;)
« Last Edit: 27 / August / 2010, 13:09:28 by pixeldoc2000 »

 

Related Topics