CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
boot.c-Dateireferenz
#include "lolevel.h"
#include "platform.h"
#include "core.h"
+ Include-Abhängigkeitsdiagramm für boot.c:

gehe zum Quellcode dieser Datei

Funktionen

void CreateTask_spytask ()
 
void taskCreateHook (int *p)
 
void boot ()
 
void __attribute__ ((naked, noinline))
 

Variablen

const char *const new_sa = &_end
 

Dokumentation der Funktionen

void __attribute__ ( (naked, noinline)  )

!!

Definiert in Zeile 63 der Datei boot.c.

63  {
64 asm volatile (
65 " LDR R0, =0xFFC0021C \n"
66 " MOV R1, #0 \n"
67 " LDR R3, =0xFFC00254 \n"
68 
69 "loc_FFC001B0:\n"
70 " CMP R0, R3 \n"
71 " LDRCC R2, [R0], #4 \n"
72 " STRCC R2, [R1], #4 \n"
73 " BCC loc_FFC001B0 \n"
74 " LDR R0, =0xFFC00254 \n"
75 " MOV R1, #0x4B0 \n"
76 " LDR R3, =0xFFC00468 \n"
77 
78 "loc_FFC001CC:\n"
79 " CMP R0, R3 \n"
80 " LDRCC R2, [R0], #4 \n"
81 " STRCC R2, [R1], #4 \n"
82 " BCC loc_FFC001CC \n"
83 " MOV R0, #0xD2 \n"
84 " MSR CPSR_cxsf, R0 \n"
85 " MOV SP, #0x1000 \n"
86 " MOV R0, #0xD3 \n"
87 " MSR CPSR_cxsf, R0 \n"
88 " MOV SP, #0x1000 \n"
89 " LDR R0, =0x6C4 \n"
90 " LDR R2, =0xEEEEEEEE \n"
91 " MOV R3, #0x1000 \n"
92 
93 "loc_FFC00200:\n"
94 " CMP R0, R3 \n"
95 " STRCC R2, [R0], #4 \n"
96 " BCC loc_FFC00200 \n"
97 " BL sub_FFC00FB8_my \n" // --> Patched. Old value = 0xFFC00FB8.
98 );
99 }
void boot ( )

Definiert in Zeile 27 der Datei boot.c.

28 {
29  long *canon_data_src = (void*)0xFFE9C5D0;
30  long *canon_data_dst = (void*)0x1900;
31  long canon_data_len = 0xf0c4 - 0x1900; // data_end - data_start
32  long *canon_bss_start = (void*)0xf0c4; // just after data
33  long canon_bss_len = 0x9d024 - 0xf0c4;
34 
35  long i;
36 
37 
38  // Enable CPU caches and MPU
39  asm volatile (
40  "MRC p15, 0, R0,c1,c0\n"
41  "ORR R0, R0, #0x1000\n"
42  "ORR R0, R0, #4\n"
43  "ORR R0, R0, #1\n"
44  "MCR p15, 0, R0,c1,c0\n"
45  :::"r0");
46 
47  for(i=0;i<canon_data_len/4;i++)
48  canon_data_dst[i]=canon_data_src[i];
49 
50  for(i=0;i<canon_bss_len/4;i++)
51  canon_bss_start[i]=0;
52 
53  *(int*)0x1930=(int)taskCreateHook;
54  *(int*)0x1934=(int)taskCreateHook;
55 
56  // jump to init-sequence that follows the data-copy-routine
57  asm volatile ("B sub_FFC001A4_my\n");
58 };
void CreateTask_spytask ( )

Definiert in Zeile 13 der Datei boot.c.

14 {
15  _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
16 }
void taskCreateHook ( int *  p)

Definiert in Zeile 18 der Datei boot.c.

18  {
19  p-=16;
20  if (p[0]==(int)0xffc4cb64) p[0]=(int)capt_seq_task;
21  if (p[0]==(int)0xffc91454) p[0]=(int)exp_drv_task;
22  if (p[0]==(int)0xffc49b18) p[0]=(int)movie_record_task;
23  if (p[0]==(int)0xffdbfc80) p[0]=(int)filewritetask;
24  if (p[0]==(int)0xffc5f754) p[0]=(int)init_file_modules_task;
25 }

Variablen-Dokumentation

const char* const new_sa = &_end

Definiert in Zeile 8 der Datei boot.c.