CHDK_DE Vorschauversion  Trunk Rev. 5637
 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))
 
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)  )

!!

Definiert in Zeile 17 der Datei boot.c.

24 {
25  long *canon_data_src = (void*)0xFFBB18F0;
26  long *canon_data_dst = (void*)0x1900;
27  long canon_data_len = 0xD610;
28  long *canon_bss_start = (void*)0xEF10; // just after data
29  long canon_bss_len = 0xA7910 - 0xEF10;
30  long i;
31 
32  asm volatile (
33  "MRC p15, 0, R0,c1,c0\n"
34  "ORR R0, R0, #0x1000\n"
35  "ORR R0, R0, #4\n"
36  "ORR R0, R0, #1\n"
37  "MCR p15, 0, R0,c1,c0\n"
38  :::"r0");
39 
40  for(i=0;i<canon_data_len/4;i++)
41  canon_data_dst[i]=canon_data_src[i];
42 
43  for(i=0;i<canon_bss_len/4;i++)
44  canon_bss_start[i]=0;
45 
46  asm volatile (
47  "MRC p15, 0, R0,c1,c0\n"
48  "ORR R0, R0, #0x1000\n"
49  "BIC R0, R0, #4\n"
50  "ORR R0, R0, #1\n"
51  "MCR p15, 0, R0,c1,c0\n"
52  :::"r0");
53 
54  h_usrInit();
55 }
void boot ( )

Definiert in Zeile 43 der Datei boot.c.

43  {
44 
45  long *canon_data_src = (void*)0xFFEDAC70; // value taken at ROM:FFC00188
46  long *canon_data_dst = (void*)0x1900;
47  long canon_data_len = 0xDF84 - 0x1900; // data_end - data_start 0xDF7C taken at ROM:FFC00138
48  long *canon_bss_start = (void*)0xDF84; // just after data
49  long canon_bss_len = 0xD4F38 - 0xDF84; // d4ec8 taken at ROM:FFC00FB4
50 
51  long i;
52 
53  // enable caches and write buffer...
54  // this is a carryover from old dryos ports, may not be useful
55  asm volatile (
56  "MRC p15, 0, R0,c1,c0\n"
57  "ORR R0, R0, #0x1000\n"
58  "ORR R0, R0, #4\n"
59  "ORR R0, R0, #1\n"
60  "MCR p15, 0, R0,c1,c0\n"
61  :::"r0"
62  );
63 
64  for(i=0;i<canon_data_len/4;i++)
65  canon_data_dst[i]=canon_data_src[i];
66 
67  for(i=0;i<canon_bss_len/4;i++)
68  canon_bss_start[i]=0;
69 
70  asm volatile ("B sub_FFC001A4_my\n");
71 };
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 58 der Datei boot.c.

59 {
60  asm volatile (
61  "STR LR, [SP,#-4]!\n"
62  "BL sub_FF811968\n"
63  "MOV R0, #2\n"
64  "MOV R1, R0\n"
65  "BL sub_FFB98428\n"
66  "BL sub_FFB8AAD4\n"
67  "BL sub_FF8111C4\n"
68  "BL sub_FF811728\n"
69  "LDR LR, [SP],#4\n"
70  "B h_usrKernelInit\n"
71  );
72 }
void h_usrKernelInit ( )

Definiert in Zeile 74 der Datei boot.c.

75 {
76  asm volatile (
77  "STMFD SP!, {R4,LR}\n"
78  "SUB SP, SP, #8\n"
79  "BL sub_FFB98928\n"
80  "BL sub_FFBAB710\n"
81  "LDR R3, =0xDF30\n"
82  "LDR R2, =0xA3DA0\n"
83  "LDR R1, [R3]\n"
84  "LDR R0, =0xA72D0\n"
85  "MOV R3, #0x100\n"
86  "BL sub_FFBA4820\n"
87  "LDR R3, =0xDEF0\n"
88  "LDR R0, =0xE738\n"
89  "LDR R1, [R3]\n"
90  "BL sub_FFBA4820\n"
91  "LDR R3, =0xDFAC\n"
92  "LDR R0, =0xA72A4\n"
93  "LDR R1, [R3]\n"
94  "BL sub_FFBA4820\n"
95  "BL sub_FFBAFACC\n"
96  "BL sub_FF8112AC\n"
97  "MOV R4, #0\n"
98  "MOV R3, R0\n"
99  "MOV R12, #0x800\n"
100  "LDR R0, =h_usrRoot\n"
101  "MOV R1, #0x4000\n"
102  );
103 // "LDR R2, =0xE7910\n" // 0xA7910 + 0x40000
104  asm volatile (
105  "LDR R2, =new_sa\n"
106  "LDR R2, [R2]\n"
107  );
108  asm volatile (
109  "STR R12, [SP]\n"
110  "STR R4, [SP,#4]\n"
111  "BL sub_FFBA8950\n"
112  "ADD SP, SP, #8\n"
113  "LDMFD SP!, {R4,PC}\n"
114  );
115 }
void h_usrRoot ( )

Definiert in Zeile 118 der Datei boot.c.

119 {
120  asm volatile (
121  "STMFD SP!, {R4,R5,LR}\n"
122  "MOV R5, R0\n"
123  "MOV R4, R1\n"
124  "BL sub_FF8119D0\n"
125  "MOV R1, R4\n"
126  "MOV R0, R5\n"
127  "BL sub_FFB9D5BC\n"
128  "MOV R1, R4\n"
129  "MOV R0, R5\n"
130  "BL sub_FFB9E034\n"
131  "BL sub_FF8117E8\n"
132  "BL sub_FF811704\n"
133  "BL sub_FF811A0C\n"
134  "BL sub_FF8119F0\n"
135  "BL sub_FF811A38\n"
136  "BL sub_FF8119C4\n"
137  );
138 
141 
142  drv_self_hide();
143 
144  asm volatile (
145  "LDMFD SP!, {R4,R5,LR}\n"
146  "B sub_FF81136C\n"
147  );
148 }

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