CHDK_DE Vorschauversion  Trunk Rev. 5429
 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 createHook (void *pNewTcb)
 
void deleteHook (void *pTcb)
 
void boot ()
 
void __attribute__ ((naked, noinline))
 *-------------------------------------------------------------------— Mehr ...
 
void h_usrInit ()
 
void h_usrKernelInit ()
 
void h_usrRoot ()
 

Variablen

const char *const new_sa = &_end
 
long wrs_kernel_bss_start
 
long wrs_kernel_bss_end
 

Dokumentation der Funktionen

void __attribute__ ( (naked, noinline)  )

*-------------------------------------------------------------------—

!!

IS_ERROR( hSoundHandle )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

"MOV R3, #0\n" "STR R3, [R9]\n"

TODO! below is from sd400

"MOV R3, #0\n" "STR R3, [R9]\n"

TODO! below is from sd400

Definiert in Zeile 16 der Datei boot.c.

23 {
24  asm volatile (
25  "LDR R4, =0xFB10\n"
26  "LDR R2, [R4,#0x38]\n"
27  "TST R2, #0x8000\n"
28  "BEQ loc_FF828F1C\n"
29  "MOV R2, #0x8000\n"
30  "MOV R0, #0x2F\n"
31  "MOV R1, #2\n"
32  "BL sub_FF8294CC\n"
33  "LDR R3, [R4,#0x38]\n"
34  "BIC R3, R3, #0x8000\n"
35  "STR R3, [R4,#0x38]\n"
36  "MOV R2, R3\n"
37  "loc_FF828F1C:\n"
38  "TST R2, #2\n"
39  "BEQ loc_FF828F44\n"
40  "MOV R1, #2\n"
41  "MOV R2, R1\n"
42  "MOV R0, #0x21\n"
43  "BL sub_FF8294CC\n"
44  "LDR R3, [R4,#0x38]\n"
45  "BIC R3, R3, #2\n"
46  "STR R3, [R4,#0x38]\n"
47  "MOV R2, R3\n"
48  "loc_FF828F44:\n"
49  "TST R2, #4\n"
50  "BEQ loc_FF828F6C\n"
51  "MOV R2, #4\n"
52  "MOV R0, #0x22\n"
53  "MOV R1, #2\n"
54  "BL sub_FF8294CC\n"
55  "LDR R3, [R4,#0x38]\n"
56  "BIC R3, R3, #4\n"
57  "STR R3, [R4,#0x38]\n"
58  "MOV R2, R3\n"
59  "loc_FF828F6C:\n"
60  "ADD R1, R4, #0x30\n"
61  "LDMIA R1, {R1,R3}\n"
62  "ADD R3, R1, R3\n"
63  "CMN R3, R2\n"
64  "BEQ loc_FF828F84\n"
65  "BL sub_FF82952C\n"
66  "loc_FF828F84:\n"
67  "LDR R3, =0x1FCC\n"
68  "LDR R1, [R3]\n"
69  "CMP R1, #1\n"
70  "BNE loc_FF828FA0\n"
71  "MOV R0, #0\n"
72  "MOV R2, R1\n"
73  "BL sub_FF8294CC\n"
74  "loc_FF828FA0:\n"
75  "BL sub_FF829C08\n"
76  "B mykbd_task_proceed_2\n"
77  );
78 }
void boot ( )

Definiert in Zeile 38 der Datei boot.c.

38  { //#fs
39  long *canon_data_src = (void*)0xFFEBFB4C;
40  long *canon_data_dst = (void*)0x1900;
41  long canon_data_len = 0xD700 - 0x1900; // data_end - data_start
42  long *canon_bss_start = (void*)0xD700; // just after data
43  long canon_bss_len = 0xA47E0 - 0xD700;
44 
45  long i;
46 
47 
48  // Code taken from VxWorks CHDK. Changes CPU speed?
49  asm volatile (
50  "MRC p15, 0, R0,c1,c0\n"
51  "ORR R0, R0, #0x1000\n"
52  "ORR R0, R0, #4\n"
53  "ORR R0, R0, #1\n"
54  "MCR p15, 0, R0,c1,c0\n"
55  :::"r0");
56 
57  for(i=0;i<canon_data_len/4;i++)
58  canon_data_dst[i]=canon_data_src[i];
59 
60  for(i=0;i<canon_bss_len/4;i++)
61  canon_bss_start[i]=0;
62 
63 /* asm volatile (
64  "MRC p15, 0, R0,c1,c0\n"
65  "ORR R0, R0, #0x1000\n"
66  "BIC R0, R0, #4\n"
67  "ORR R0, R0, #1\n"
68  "MCR p15, 0, R0,c1,c0\n"
69  :::"r0");
70 */
71 
72  *(int*)0x1930=(int)taskCreateHook;
73  *(int*)0x1934=(int)taskCreateHook;
74  *(int*)0x1938=(int)taskCreateHook2;
75 
76  // jump to init-sequence that follows the data-copy-routine
77  asm volatile ("B sub_FFC001A4_my\n");
78 }; //#fe
void createHook ( void *  pNewTcb)

Definiert in Zeile 102 der Datei main.c.

103 {
104  char *name = (char*)(*(long*)((char*)pNewTcb+0x34));
105  long *entry = (long*)((char*)pNewTcb+0x74);
106 
107  // always hook first task creation
108  // to create SpyProc
109  if (!stop_hooking){
110  task_prev = (void*)(*entry);
111  *entry = (long)task_start_hook;
112  stop_hooking = 1;
113  } else {
114  // hook/replace another tasks
115  if (my_ncmp(name, "tPhySw", 6) == 0){
116  *entry = (long)physw_hook;
117  }
118 
119  if (my_ncmp(name, "tInitFileM", 10) == 0){
120  init_file_modules_prev = (void*)(*entry);
121 #if CAM_MULTIPART
122  *entry = (long)init_file_modules_task;
123 #else
124  *entry = (long)init_file_modules_hook;
125 #endif
126  }
127 
128  if (my_ncmp(name, "tCaptSeqTa", 10) == 0){
129  *entry = (long)capt_seq_hook;
130  }
131 
132 #if CAM_CHDK_HAS_EXT_VIDEO_MENU
133  if (my_ncmp(name, "tMovieReco", 10) == 0){
134  *entry = (long)movie_record_hook;
135  }
136 #endif
137 
138 #if CAM_EXT_TV_RANGE
139  if (my_ncmp(name, "tExpDrvTas", 10) == 0){
140  *entry = (long)exp_drv_task;
141  }
142 #endif
143 
144 #if CAM_HAS_FILEWRITETASK_HOOK
145  if (my_ncmp(name, "tFileWrite", 10) == 0){
146  *entry = (long)filewritetask;
147  }
148 #endif
149 
150 // for cameras that have a "touch control dial" with 'TouchW' task.
151 // some cameras may use a different task name
152 #ifdef HOOK_TOUCHW
153  if (my_ncmp(name, "tTouchW", 7) == 0){
154  *entry = (long)my_touchw_task;
155  }
156 #endif
157 
158  core_hook_task_create(pNewTcb);
159  }
160 }
void deleteHook ( void *  pTcb)

Definiert in Zeile 162 der Datei main.c.

163 {
164  core_hook_task_delete(pTcb);
165 }
void h_usrInit ( )

Definiert in Zeile 222 der Datei boot.c.

223 {
224  asm volatile (
225  "STR LR, [SP,#-4]!\n"
226  "BL sub_FF811A40\n"
227  "MOV R0, #2\n"
228  "MOV R1, R0\n"
229  "BL sub_FFAB514C\n"
230  "BL sub_FFAA1824\n"
231  "BL sub_FF811298\n"
232  "BL sub_FF811800\n"
233  "LDR LR, [SP],#4\n"
234  "B h_usrKernelInit\n"
235  );
236 }
void h_usrKernelInit ( )

Definiert in Zeile 238 der Datei boot.c.

239 {
240  asm volatile (
241  "STMFD SP!, {R4,LR}\n"
242  "SUB SP, SP, #8\n"
243  "BL sub_FFAB564C\n"
244  "BL sub_FFAC7E58\n"
245  "LDR R3, =0xE07C\n"
246  "LDR R2, =0x78500\n"
247  "LDR R1, [R3]\n"
248  "LDR R0, =0x7BC70\n"
249  "MOV R3, #0x100\n"
250  "BL sub_FFAC3788\n"
251  "LDR R3, =0xE03C\n"
252  "LDR R0, =0xE45C\n"
253  "LDR R1, [R3]\n"
254  "BL sub_FFAC3788\n"
255  "LDR R3, =0xE0F8\n"
256  "LDR R0, =0x7BC44\n"
257  "LDR R1, [R3]\n"
258  "BL sub_FFAC3788\n"
259  "BL sub_FFACC9D8\n"
260  "BL sub_FF811384\n"
261  "MOV R4, #0\n"
262  "MOV R3, R0\n"
263  "MOV R12, #0x800\n"
264  "LDR R0, =h_usrRoot\n"
265  "MOV R1, #0x4000\n"
266  );
267 // "LDR R2, =0xAC2B0\n" // 0x7C2B0 + 0x30000
268  asm volatile (
269  "LDR R2, =new_sa\n"
270  "LDR R2, [R2]\n"
271  );
272  asm volatile (
273  "STR R12, [SP]\n"
274  "STR R4, [SP,#4]\n"
275  "BL sub_FFAC5098\n"
276  "ADD SP, SP, #8\n"
277  "LDMFD SP!, {R4,PC}\n"
278  );
279 }
void h_usrRoot ( )

Definiert in Zeile 283 der Datei boot.c.

284 {
285  asm volatile (
286  "STMFD SP!, {R4,R5,LR}\n"
287  "MOV R5, R0\n"
288  "MOV R4, R1\n"
289  "BL sub_FF811AA8\n"
290  "MOV R1, R4\n"
291  "MOV R0, R5\n"
292  "BL sub_FFABB7C8\n"
293  "MOV R1, R4\n"
294  "MOV R0, R5\n"
295  "BL sub_FFABC240\n"
296  "BL sub_FF8118C0\n"
297  "BL sub_FF8117DC\n"
298  "MOV R0, #0x32\n"
299  "BL sub_FFABE1E4\n"
300  "BL sub_FF811AEC\n"
301  "BL sub_FF811ACC\n"
302  "BL sub_FF811B18\n"
303  "BL sub_FFABDAA4\n"
304  "BL sub_FF811A9C\n"
305  );
306 
309 
310  drv_self_hide();
311 
312  asm volatile (
313  "LDMFD SP!, {R4,R5,LR}\n"
314  "B sub_FF811444\n"
315  );
316 }

Variablen-Dokumentation

const char* const new_sa = &_end

Definiert in Zeile 5 der Datei boot.c.

long wrs_kernel_bss_end
long wrs_kernel_bss_start