experimental alternate memory allocation

  • 128 Replies
  • 15237 Views
*

Offline philmoz

  • *****
  • 2936
    • Photos
Re: experimental alternate memory allocation
« Reply #40 on: 05 / January / 2011, 16:32:14 »
Advertisements
So now the problem is what extra initialisation is needed, and where can the call to exmem_malloc_init be done that works all the time?
Your mission, should you choose to accept it is... ;)


More than happy to investigate this; but it won't be for a while.
I'm going to be traveling and will have only limited internet access from tomorrow until late Feb (not sure how I'll survive)  :(

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)

*

Offline reyalp

  • ******
  • 10057
Re: experimental alternate memory allocation
« Reply #41 on: 05 / January / 2011, 22:41:53 »

More than happy to investigate this; but it won't be for a while.
Your work so far is appreciated, have a great trip.
Quote
I'm going to be traveling and will have only limited internet access from tomorrow until late Feb (not sure how I'll survive)  :(
Have to take some pretty pictures or something  :D
Don't forget what the H stands for.

Re: experimental alternate memory allocation
« Reply #42 on: 29 / January / 2011, 19:19:32 »
On the S95, I need memory for inverted playback of images or playback as stereo anaglyph images (using 'hikerjon's code).

I can allocate 1 MB of extra memory and movies are not corrupted.

As soon as I try to load a uBasic script, the camera crashes on malloc() in gui_fselect_read_dir(..).

Any ideas ?

I am not sure my d10 disassembly is correct.
The only EXMEM_ strings that I see start at 0xFFB4871E.

At 0xFFB5031C, I only see a list of DCB values starting with 0x12.

Re: experimental alternate memory allocation
« Reply #43 on: 30 / January / 2011, 07:41:09 »
>As soon as I try to load a uBasic script, the camera crashes on malloc() in gui_fselect_read_dir(..).

>Any ideas ?

what does a testcode show simular as this show  ?

http://chdk.setepontos.com/index.php?topic=5980.msg59269#msg59269

the external mem work really stable on my camera(but of course when i report bugs here i disable it and test), when i alloc short after exmem init 2 megabyte of mem which i never use.
« Last Edit: 30 / January / 2011, 07:46:50 by Bernd R »
Ixus 1000 HS


Re: experimental alternate memory allocation
« Reply #44 on: 30 / January / 2011, 10:07:51 »
Thanks Bernd.

I don't think reyalp has noticed my question about the d10.

If you have S95 100H firmware available could you tell me where the EXMEM_ strings are in case my disassembly is incorrect ?

David
« Last Edit: 30 / January / 2011, 12:57:29 by Microfunguy »

Re: experimental alternate memory allocation
« Reply #45 on: 30 / January / 2011, 12:42:53 »
>SDM does not support Lua but I will ask again if I decide to test a CHDK version.

this is no LUA code, its C code in chdk that test the mem if overwritten, but i think you can copy it easy to SDM.read also some post before,

http://chdk.setepontos.com/index.php?topic=5980.msg59219#msg59219

here philmoz post his testcode, i change the code for my test, so can work with diffrent addresses

so you can be sure, that there really no Canon function overwrite your memory.I think before this is test and known as work on a camera, better not use expand mem.

seem Canon firmare catch here mem and mark it not as alloc
« Last Edit: 30 / January / 2011, 12:47:05 by Bernd R »
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 10057
Re: experimental alternate memory allocation
« Reply #46 on: 30 / January / 2011, 14:36:43 »
As soon as I try to load a uBasic script, the camera crashes on malloc() in gui_fselect_read_dir(..).

Any ideas ?
It's not clear to me what code you are using. If malloc crashes, maybe you have the wrong alloc function, or your heap got corrupted somehow.  You could examine the pointers returned by your malloc and see if they make sense. You can also examine the output of ExMem.View (using uart redirection)
Quote
I am not sure my d10 disassembly is correct.
The only EXMEM_ strings that I see start at 0xFFB4871E.

At 0xFFB5031C, I only see a list of DCB values starting with 0x12.
Again, I'm not sure what you are looking for. I put the correct entry points in stubs_entry_2.s for this camera, you should be able work backwards from those to see how they relate to the strings.

The strings just help you find the event procs which help you find the actual functions.

The strings at FFB4871E are related to displaying the EXMEM info (by ExMem.View), 0x12 is the number of EXMEM types.

FWIW,
ROM:FF824410             eventproc_export_ExMem <- registers all the exmem event procs. You can find the eventproc names and functions pointers there.

If you are working on a different dump, search for "ExMem.AllocCacheable"
Don't forget what the H stands for.

Re: experimental alternate memory allocation
« Reply #47 on: 30 / January / 2011, 18:38:40 »
Well, the S95 allocated memory starts at 0x7bfffe0 for 4MB and 0x77fffe0 for 8 MB.

The first 35,292 bytes are already overwritten on power-up, increasing to 765,724 after recording a 1280 movie and 895,325 after playing back the movie.
I allocated 4MB and immediately after allocated a never-used 2MB.

Edge overlay and movie record and playback are OK, script menu trashed.

« Last Edit: 30 / January / 2011, 20:51:05 by Microfunguy »


Re: experimental alternate memory allocation
« Reply #48 on: 31 / January / 2011, 04:45:47 »
>Edge overlay and movie record and playback are OK, script menu trashed.

I test now and i notice a crash, when i want load a scriptfile from play menu

it happen as soon i alloc exmem but chdk do not use it

I wonder what chdk do special here, i get in mind it want open a file requester.
so i get in mind, to test filebrowser.and here too, when i call menu file browser, camera crash
this is what romlog show(romlog is with exmem used chdk, because i test last this.)

@exmem testers
Does filebrowser work on your Cams ?

Exception!! Vector 0x10
Occured Time  2011:01:31 10:37:58
Task ID: 16908323
Task name: PhySw
« Last Edit: 31 / January / 2011, 05:06:56 by Bernd R »
Ixus 1000 HS

Re: experimental alternate memory allocation
« Reply #49 on: 31 / January / 2011, 05:11:31 »
I test now and i notice a crash, when i want load a scriptfile from play menu

it happen as soon i alloc exmem but chdk do not use it

Yes, exactly the problem I have except the camera is in Record mode when I tested.

Quote
Does filebrowser work on your Cams ?

No, it crashes as soon as I choose a folder.
« Last Edit: 31 / January / 2011, 05:14:55 by Microfunguy »

 

Related Topics