I am not sure what cached vs uncached means in terms of Canon cameras, or what the difference is.
Is it just a speed difference or are there other issues?
And do you have a suggestion on where should I put the firmware for the A530?
"only" speed AFAIK, but remember the camera may expect some things to execute within a given time. If they didn't need it, they wouldn't bother with an instruction cache. Maybe it would just be slow, or maybe it will fail.
Note also (as I mentioned earlier) you have to deal with cache coherency when you are copying code around.
No, as I've said from the beginning I believe the entire concept is unworkable.
You'd be much better of relocating small chunks as needed, similar to how CHDK copies code to hijack specific tasks, but automated and at run time.
Instead of trying to relocate the entire firmware and worrying about finding every code reference, my approach has been to relocate to RAM just the functions that I need to change. Since I am targetting Canon dialog code that is called through a function pointer, my code is able to walk the GUI structures in RAM to find the pointer to the ROM routine and update it there. On the next redraw or event cycle the relocated code will be called instead and can execute my modified instructions.reloc.c has the routines that do the copy and instruction fixup. The only instructions that are currently fixed are:* B* BL* LDR rN, [ pc, off ]
But if you do that, don't you have to relocate the functions that are used by that function as well? And since many functions are linked with lots of other functions, isn't that relocating like half of the firmware?
uint32_t offset = instr & BRANCH_OFFSET; // Sign extend the offset if( offset & 0x00800000 ) offset |= 0xFF000000; uintptr_t dest = pc + (offset << 2) + 8; // Ignore branches inside the reloc space if( func_offset <= dest && dest < func_end ) continue; int32_t new_jump = (dest - new_pc - 8); new_jump >>= 2; uint32_t new_instr = 0 | (instr & ~BRANCH_OFFSET) | (new_jump & BRANCH_OFFSET);
Well, if you do a B in another function, how are you going to get the control back to your function? Or you don't care about that? the BLs should be easier, IF the called function will actually return gracefully to the function that called it, but is that guaranteed?
Started by wrybread General Help and Assistance on using CHDK stable releases
Started by PhyrePhoX « 1 2 ... 5 6 » General Help and Assistance on using CHDK stable releases
Started by LjL General Discussion and Assistance
Started by madcat General Chat
Started by keebler Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)