#define FW_ADDRESS 0xFF810000#define FW_SIZE 0x400000#define START_SECTOR 256// maximum number of hex digits this will be outputting// (there is a fudge factor of 10 additional digits built in// to help avoid overrun...)#define HEX_LENGTH 8#define LED_PR 0xC02200CC #define LED_GR 0xC0220136#define LED_OR 0xC0220133#define LED_AF 0xC0223030#define DOT_DURATION 0.05#define DOT_PAUSE 0.05#define DASH_DURATION 0.2#define DASH_PAUSE 0.2#define BETWEEN_NUMBER_PAUSE 0.3#define DEL 50000// side note... // wouldn't it be ironic if we inlined the function // that is supposed to kill time?void delay(float i){ int j; j = i * 30 * DEL; while(--j) { asm("nop\n"); asm("nop\n"); asm("nop\n"); asm("nop\n"); }}inline void led_on(long led_addr) { volatile long *p; p=(void*)led_addr; *p=0x46;}inline void led_off(long led_addr) { volatile long *p; p=(void*)led_addr; *p=0x44;}// output a dot on the given LED address// (a 'dot' is a quick blip of the LED)void output_dot(long led_addr) { delay(DOT_PAUSE); led_on(led_addr); delay(DOT_DURATION); led_off(led_addr); #endif}// output a dash on the given LED address// (dash is longer than a dot)void output_dash(long led_addr) { delay(DASH_PAUSE); led_on(led_addr); delay(DASH_DURATION); led_off(led_addr);}typedef int (*f_w)(int, int, int, int); // drive(?), start sector, number of sectors, address int main() { int i, j; int tw, tr; int *p; f_w wr; output_dot(LED_OR); output_dot(LED_GR); output_dot(LED_OR); output_dot(LED_PR); output_dot(LED_AF); for (i=0x1900;i<0xF0000;i+=4) if ((*(unsigned int*)(i+0x34)==0) && (*(unsigned int*)(i+0x38)==0) && (*(unsigned int*)(i+0x3C)==3) && (*(unsigned int*)(i+0x4C)>FW_ADDRESS) && (*(unsigned int*)(i+0x50)>FW_ADDRESS) ) { output_dot(LED_OR); output_dot(LED_OR); output_dot(LED_OR); delay(0.5); wr=(f_w)*(unsigned int*)(i+0x50); // blink three times if its at the right address // (note - on my camera, it blinks 3 times with this function...) if ((unsigned int)wr == (unsigned int)(0xFF9182FC)) { int p; for (p=0;p<3;p++) { led_on(LED_AF); led_on(LED_GR); led_on(LED_PR); delay(0.1); led_off(LED_AF); led_off(LED_GR); led_off(LED_PR); delay(0.1); } } else { // if none of the above addresses match - display error led_on(LED_OR); delay(0.1); led_off(LED_OR); delay(0.1); led_on(LED_OR); delay(0.1); led_off(LED_OR); } // fill some memory with zeroes; "simulate" large diskboot // WARNING: the starting address is a guess for (j = 0x2e20; j<0x27100; j+=4) { p = (int *) j; *p = 0; } // delay to allow time to unlock the memory card // if I'm trying to do that... int q = 0; for (q=0; q<50; q++) { led_on(LED_GR); delay(0.01); led_off(LED_GR); delay(0.01); } delay(0.1); led_on(LED_OR); wr(0,START_SECTOR,FW_SIZE/512,FW_ADDRESS); led_off(LED_OR); } // would blink 5 times if wr() would return (which it doesn't, but still works) for (j=5; j>0; j--) { output_dot(LED_OR); } while(1); return 0;}
How does the RAM map on these? What would be the largest value that I should write 0's to? 0xF000000?
I don't see anything I'm doing wrong...
I already considered running the whole firmware in a virtual machine that is started via diskboot Smiley
hm. lets see1) people had some problems with turning theirs cameras in play mode (because there were no switch). I think they held down some button on powerup.I can't recall what these camera models are.2) canon changed firmware so it ignores bootable card or name of the file on it.what card do you use? can you use small memory card supplied with camera?you can try to1) hold some buttons while powering up ( there were some instructions floating about G7 or G9). i think somebody will give you more precise instructions.2) add ps.fi2 file on card and see if update menu appears
#define MIN_ADDRESS 0xFF810000#define FW_SIZE 0x400000#define START_SECTOR 2048#define LED_AF 0xc0223030void led_on(){ volatile long *p=(void*)LED_AF; *p=0x46;}void led_off(){ volatile long *p=(void*)LED_AF; *p=0x44;}void idle(){ int i; for(i=0;i<0x78800;i++){ asm ("nop\n"); asm ("nop\n"); asm ("nop\n"); asm ("nop\n"); }}typedef int (*f_w)(int, int, int, int); // drive(?), start sector, number of sectors, address int main() { int i; unsigned long sa; f_w wr; led_on(); idle(); led_off(); idle(); led_on(); for (i=0x1900;i<0xF0000;i+=4) if ((*(unsigned int*)(i+0x34)==0) && (*(unsigned int*)(i+0x38)==0) && (*(unsigned int*)(i+0x3C)==3) && (*(unsigned int*)(i+0x4C)>MIN_ADDRESS) && (*(unsigned int*)(i+0x50)>MIN_ADDRESS) ) { wr=(f_w)*(unsigned int*)(i+0x50); sa=(unsigned long)wr>0xFFC00000 ? 0xFFC00000 : 0xFF810000; wr(0, START_SECTOR, FW_SIZE/512, sa); break; } led_off(); while(1); return 0;}
decode.c:Warning W8065 decode.c 79: Call to function 'resetkey' with no prototype in function encodefileWarning W8060 decode.c 100: Possibly incorrect assignment in function encodefileWarning W8065 decode.c 110: Call to function 'xencode' with no prototype in function encodefileWarning W8065 decode.c 114: Call to function 'resetkey' with no prototype in function encodefileWarning W8065 decode.c 114: Call to function 'rotatekey' with no prototype in function encodefileTurbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
while (read = fread(data, 1, 8, f)) {
while (read == fread(data, 1, 8, f)) {