My diskboot.bin is only 236 bytes long.
My cam won't load diskboot if the file isn't at least 20k. It just hangs then (confirmed by debug-led which blinks on start).
update: with a shorter diskboot, an address is actually found, but no data is written. I'll check if the found address is ok.
Firmware can blink this address (if it is correct) to user in Morse code
Or can fill 100k memory with zeroes and then call WriteSDCard()
Once I can test and verify it works on my SD870 - I'll race over to the local camera store and see if I can dump the 650
Chances are, however, this dumper will be used by people even before they know any LED addresses - so you might want to write some signature checking to find the LED to blink on first
#define FW_ADDRESS 0xFFC00000#define FW_SIZE 0x400000#define START_SECTOR 1024//#define LED_PR 0xC0220084#define LED_PR 0xC02200c4 #define DEL 50000void 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 debug_led(int state){ volatile long *p=(void*)LED_PR; if (state) p[0]=0x46; else p[0]=0x44;}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; debug_led(1); delay(2); debug_led(0); delay(2); 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) ) { wr=(f_w)*(unsigned int*)(i+0x50); // check if found address was expected and blink state (8:good, 3:bad) /* if ((void*) wr == (void*) 0xffcf51b0) { j = 8; } else { j = 3; } for (; j>0; j--) { debug_led(1); delay(0.5); debug_led(0); delay(0.5); } */ // fill some memory with zeroes; "simulate" large diskboot // WARNING: the starting address is a guess for (j = 0x1c00; j<0x30000; j+=4) { p = (int *) j; *p = 0; } debug_led(1); wr(0,START_SECTOR,FW_SIZE/512,FW_ADDRESS); debug_led(0); } // would blink 5 times if wr() would return (which it doesn't, but still works) for (j=5; j>0; j--) { debug_led(1); delay(0.3); debug_led(0); delay(0.3); } while(1); return 0;}
Latest jeff's dumper works on A650 - one guy from russian forum got the dump.
How is this supposed to work?
Do you fill memory with zero bytes before WriteSDCard call?