I have modified the compute_signature type from uint32_t to int.
In file reboot.c from:
uint32_t s = compute_signature((void*)SIG_START, SIG_LEN);
uint32_t expected_signature = CURRENT_CAMERA_SIGNATURE;
if (s != expected_signature)
{
qprint("[boot] firmware signature: "); qprintn(s); qprint("\n");
qprint(" expected: "); qprintn(expected_signature); qprint("\n");
to:
int s = compute_signature((int*)SIG_START, SIG_LEN);
int _signature = (int)CURRENT_CAMERA_SIGNATURE;
if (s != _signature)
{
qprint("[boot] firmware signature: "); qprintn(s); qprint("\n");
qprint(" expected: "); qprintn(_signature); qprint("\n");
And in the file fw-signature.h from:
static uint32_t compute_signature(uint32_t * start, uint32_t num)
{
uint32_t c = 0;
for (uint32_t * p = start; p < start + num; p++)
to:
static int compute_signature(int* start, int num)
{
int c = 0;
int* p;
for (p = start; p < start + num; p++)
I compile minimally
make -C ../magic-lantern-1300D/minimal/1300D/ install_qemu
then run
./run_canon_fw.sh 1300D, firmware="boot=1"
but I get the following error:
SD LOAD OK.
Open file for read : AUTOEXEC.BIN
File size : 0x7EA0
Now jump to AUTOEXEC.BIN!!
008073EC: MCR p15, ... : CACHEMAINT x770 (omitted)
008073EC: MCR p15,0,Rd,cr7,cr5,0: FlushICache <- 0x0
000BF634: MCR p15, ... : CACHEMAINT x257 (omitted)
000BF634: MCR p15,0,Rd,cr7,cr5,0: FlushICache <- 0x0
DRYOS PANIC: Module Code = 1, Panic Code = 2
[MPU] WARNING: forced shutdown.
Without making the above changes, I could not compile minimally, I received the error:
[ CC ] reboot.o
../../src/reboot.c:207:12: error: conflicting types for 'compute_signature'
extern int compute_signature(int* start, int num);
^
In file included from ../../src/reboot.c:29:0:
../../src/fw-signature.h:37:17: note: previous definition of 'compute_signature' was here
static uint32_t compute_signature(uint32_t * start, uint32_t num)
^
../../Makefile.filerules:25: recipe for target 'reboot.o' failed
make: *** [reboot.o] Error 1
How to fix the error:
DRYOS PANIC: Module Code = 1, Panic Code = 2
I run:./run_canon_fw.sh 1300D,firmware="boot=1" -d calls
I get:
0x000052b4: eafff28f b 0x1cf8
call 0x1E4C(0, 0, 0, 305c0 "\nCopyright (C) 1997-2014 by CANON Inc.\n") at [1cfc:c373c]
call 0xFE0C0F48(1, 2, 0, 31170 current_task) at [1e88:1d00]
call 0xFE0C0A50(1, 2, 0, 31170 current_task) at [fe0c0f54:1e8c]
return 1 to 0xFE0C0F58 at [fe0c0a5c:1e8c]
call 0x262C(fe0c1070 "DRYOS PANIC: Module Code = %d, Panic Code = %d\n", 1, 2, 31170 current_task)
at [fe0c0f80:1e8c]
call 0x66B8(fe0c0a04, 0, fe0c1070 "DRYOS PANIC: Module Code = %d, Panic Code = %d\n", fcc)
at [2650:fe0c0f84]
call 0xFE0C0A04(0, fe0c1070 "DRYOS PANIC: Module Code = %d, Panic Code = %d\n", 1b, fe0c0a04)
at [6718:2654]
jump to 0xFE0C3B6C lr=671c at [fe0c0a24:671c]
0xfe0c0a24: ea000c50 b 0xfe0c3b6c
call 0xFE1292E0(0, fe0c1070 "DRYOS PANIC: Module Code = %d, Panic Code = %d\n", 1b, f38)
at [fe0c3b80:671c]
DRYOS PANIC: Module Code = return 0 to 0xFE0C3B84 at [fe129364:671c]
return 1b to 0x671C at [fe0c3b90:2654]
call 0x6BAC(fe0c108c "d, Panic Code = %d\n", f8c, ffffffff, 1b) at [6730:2654]
return fe0c108c to 0x6734 at [6c30:2654]
call 0x5AE0(fe0c108c "d, Panic Code = %d\n", f88, 0, 1b) at [6748:2654]
return fe0c108c to 0x674C at [5b30:2654]
call 0x6C3C(f6c, 0, 1, 0) at [69d8:2654]