Hello everybodythis project looks very interesting to me.I have a SX20 wich are not pleased with lot of memory.So, if i had understood well this discussion, we are looking for free unused memory regions on the cam and use this instead of the origin heap.How could it be, that the cam has free memory regions and canon doesn't use it?
Ok. Next step.Finding out the maximal memory amount: 8 MB ok16 MB boot crash12 MB ok14 MB ok15 MB boot crashEXMEM_RAMDISK [0x431FFFC0] , [0x00E00040]The start address of EXMEM_RAMDISK is beetween 0x431FFFC0 and 0x43DFFFC0.I've allocated the memory and wrote the test pattern on it. ok.Next step is to find out which regions are overwritten by the cam itself.@philmozi have a question to you: why you are using in gui.c first address 0x03FFFFFFC and not the address which comes from EXMEM_RAMDISK? If i try your gui.c code the cam crashes. So i tried with start address 0x043DFFFC0 and end address 0x044000000. -> cam crashes too.The same happens if i look with the memory browser on this memory address. I'am confused Some ideas?
In the current version of exmem_malloc_init the call to suba_init is passing a value of 1024 as the last parameter. This parameter sets the minimum cell size to be used in the suba allocator - this means any malloc request smaller than 1K will always allocate 1K.
This is wasting a lot of memory on startup because some of the code is allocating a large number of small chunks. For example the code to load the symbol font file allocates a 30 byte block of memory for each of the 128 symbols in the file. With the min cell size set to 1024 this ends up allocating 128K instead of ~4K it should need.
Hello everybodythis project looks very interesting to me.I have a SX20 wich are not pleased with lot of memory.So, if i had understood well this discussion, we are looking for free unused memory regions on the cam and use this instead of the origin heap.How could it be, that the cam has free memory regions and canon doesn't use it? I have some skills with c, but my asm knowledge lies long years behind me ;-). Can you give me some hints to find those memory regions? What tools you are using?Thanks a lotFrank
Without CHDK============ variables heap/stack buffers (e.g. RAW) exmem pool vid buffers|----|-----------|------------------|----------------------|---------------------|-----------|0 1900 ? 4000000 ? ? MAXRAMADDRWith CHDK (default memory)========================== variables CHDK heap/stack buffers (e.g. RAW) exmem pool vid buffers|----|-----------|----|-------------|----------------------|---------------------|-----------|0 1900 ? ? 4000000 ? ? MAXRAMADDRWith CHDK (exmem memory)========================== variables heap/stack buffers (e.g. RAW) exmem pool CHDK vid buffers|----|-----------|------------------|----------------------|-------------|-------|-----------|0 1900 ? 4000000 ? ? ? MAXRAMADDR
ROM:FF890270 EXPORT _sub_FF890270__ExMemMan.c__0ROM:FF890270 _sub_FF890270__ExMemMan.c__0 ; CODE XREF: sub_FF88FD1C+ACROM:FF890270 STMFD SP!, {R4-R8,LR}ROM:FF890274 LDR R6, =0x3BFC8ROM:FF890278 MOV R4, R0ROM:FF89027C MOV R0, #0ROM:FF890280 MOV R5, #0x48000000 <<<<<<<<<<<<<<< want this valueROM:FF890284ROM:FF890284 loc_FF890284 ; CODE XREF: _sub_FF890270__ExMemMan.c__0+38ROM:FF890284 LDR R1, [R6,R0,LSL#3]
EXMEM_BUFFER_SIZE=0x400000 # Amount of EXMEM memory to allocate for CHDK = 4MB
s:XXXXXXXX e:YYYYYYYYf:AAAAAAAA l:BBBBBBBB c:NN
ROM:FF890270 EXPORT _sub_FF890270__ExMemMan.c__0ROM:FF890270 _sub_FF890270__ExMemMan.c__0 ; CODE XREF: sub_FF88FD1C+ACROM:FF890270 STMFD SP!, {R4-R8,LR}ROM:FF890274 LDR R6, =0x3BFC8ROM:FF890278 MOV R4, R0ROM:FF89027C MOV R0, #0ROM:FF890280 MOV R5, #0x48000000ROM:FF890284ROM:FF890284 loc_FF890284 ; CODE XREF: _sub_FF890270__ExMemMan.c__0+38ROM:FF890284 LDR R1, [R6,R0,LSL#3] ...ROM:FF8902AC CMP R4, #0xBROM:FF8902B0 CMPNE R4, #0xCROM:FF8902B4 CMPNE R4, #0xDROM:FF8902B8 BNE loc_FF8902C4ROM:FF8902BC CMP R5, #0x48000000ROM:FF8902C0 LDREQ R5, =0x47D08A00 <<<<<<<<<<<<<<<<<<<< need this value for video buffer addressROM:FF8902C4ROM:FF8902C4 loc_FF8902C4 ; CODE XREF: _sub_FF890270__ExMemMan.c__0+48ROM:FF8902C4 LDR R7, =dword_FFBBB370
ifdef OPT_CHDK_IN_EXMEMMEMISOSTART=0x79089e0 # MAXRAMADDR+1 - EXMEM_HEAP_SKIP - EXMEM_BUFFER_SIZE - 32 (exmem allocates 64 bytes extra, 32 before and 32 after block allocated)elseMEMISOSTART=0x16E820 # original non-exmem valueendif
#if defined(OPT_CHDK_IN_EXMEM) "LDR R0, =0x16E820\n" // use original heap offset since CHDK is loaded in high memory#else "LDR R0, =new_sa\n" // otherwise use patched value "LDR R0, [R0]\n" // #endif
# experimental - allocate memory from alternate heap. Default 2MB from EXMEM_RAMDISK# See exmem_malloc_init in generic/wrappers.cOPT_EXMEM_MALLOC=1# Set OPT_CHDK_IN_EXMEM to build and load CHDK into EXMEM memory # Need to define MEMISOSTART and EXMEM values in PLATFORM/PLATFORMSUB/makefile.inc (see G12 or SX30 for example)# (if setting this must also set OPT_EXMEM_MALLOC !)OPT_CHDK_IN_EXMEM=1# set this to enable exmem corruption testing (see wrappers.c). (Don't set OPT_CHDK_IN_EXMEM with this !)#OPT_EXMEM_TESTING=1
Started by Microfunguy General Discussion and Assistance
Started by mp9_sit Script Writing
Started by Barney Fife Completed and Working Scripts
Started by Lebeau General Discussion and Assistance
Started by CanonBlue General Help and Assistance on using CHDK stable releases