Thanks to the great "7 point instructions" from philmoz i trust me to do the next steps...
Size of Memory: The sx20 has the same pattern like reyalp described here:
ROM:FF810040 33 00 A0 E3 MOV R0, #0x33
ROM:FF810044 12 0F 06 EE MCR p15, 0, R0,c6,c2
ROM:FF810048 CD 01 A0 E3 MOV R0, #0x40000033
ROM:FF81004C 13 0F 06 EE MCR p15, 0, R0,c6,c3
Sets up the cached and uncached regions. Lowest bit is enable, next 5 are region size.
So 0x32 => 11001 => my D10 has 64 MB according to Table 4-2
So the cam has 64MB RAM and MAXRAMADDR=0x03FFFFFF.
I dont have access to IDA, so i tried with ARMu...
exmem_alloc i found at 0xFF889D7C (sx20 1.02b)
EXMEM_HEAP_SKIP=0x2F7600 #(0x4000000-0x3D08A00) from sub_FF88A064 = size of video buffers in EXMEM area
MEMISOSTART=0x39089E0 # MAXRAMADDR+1 - EXMEM_HEAP_SKIP - EXMEM_BUFFER_SIZE - 32 (exmem allocates 64 bytes extra, 32 before and 32 after block allocated)
0x3FFFFFF MAXRAMADDR
+0x0000001
-0x02F7600 EXMEM_HEAP_SKIP
-0x0400000 EXMEM_BUFFER_SIZE
-0x0000020
=========
0x39089E0
I tested with this values (with OPT_EXMEM_TESTING) and it seems to be all fine.
With active OPT_EXMEM_MALLOC the sx20 has 4MB less ~50KB.
Show Memory Info:
Free Memory = 4144168
CHDK size = 277380
loaded at 0x13DD6C
I am going to test more features like Zebra with buffering, PTP,... this weekend.
@philmoz: Thank you very much for your great instructions.
Only point 7 OPT_CHDK_IN_EXMEM doesn't work and crashes the cam (I have to put out the batteries).
I think the problem is, that the sx20 only can start chdk while booting from SD-Card. But i am not sure.