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 18 der Datei boot.c.

25 {
26  // offset of "start of data" string in primary.bin - 4
27  // All the asm code below is from: 0xFF8100F8
28 
29  long *canon_data_src = (void*)0xFFB29580;
30  long *canon_data_dst = (void*)0x1900;
31  // up to the end of flash
32  long canon_data_len = 0xBDE0;
33  // just after ROM data
34  long *canon_bss_start = (void*)(0x1900+0xBDE0);
35  // BSS end offset (from FF810134 disasm) minus BSS start
36  long canon_bss_len = 0x9C6B0 - (long)canon_bss_start;
37  long i;
38 
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  int * data = (int*)0x170000;
48  for (i = 0; i < 30*1024*1024/4; i++) {
49  data[i] = 0xCAFEDEAD;
50  }
51 */
52 
53  for(i=0;i<canon_data_len/4;i++)
54  canon_data_dst[i]=canon_data_src[i];
55 
56  for(i=0;i<canon_bss_len/4;i++)
57  canon_bss_start[i]=0;
58 
59 
60  asm volatile (
61  "MRC p15, 0, R0,c1,c0\n"
62  "ORR R0, R0, #0x1000\n"
63  "BIC R0, R0, #4\n"
64  "ORR R0, R0, #1\n"
65  "MCR p15, 0, R0,c1,c0\n"
66  :::"r0");
67  h_usrInit();
68 }
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 71 der Datei boot.c.

72 {
73  asm volatile (
74  "STR LR, [SP,#-4]!\n"
75  "BL sub_FF81196C\n"
76  "MOV R0, #2\n"
77  "MOV R1, R0\n"
78  "BL sub_FFB0EED8\n"
79  "BL sub_FFB01B4C\n"
80  "BL sub_FF8111C4\n"
81  "BL sub_FF81172C\n"
82  "LDR LR, [SP],#4\n"
83  "B h_usrKernelInit\n"
84  );
85 }
void h_usrKernelInit ( )

Definiert in Zeile 87 der Datei boot.c.

88 {
89  asm volatile (
90  "STMFD SP!, {R4,LR}\n"
91  "SUB SP, SP, #8\n"
92  "BL sub_FFB0F3D8\n"
93  "BL sub_FFB22BE0\n"
94  "LDR R3, =0xC6F0\n"
95  "LDR R2, =0x99340\n"
96  "LDR R1, [R3]\n"
97  "LDR R0, =0x9C070\n"
98  "MOV R3, #0x100\n"
99  "BL sub_FFB1BCF0\n"
100  "LDR R3, =0xC6B0\n"
101  "LDR R0, =0xCEF8\n"
102  "LDR R1, [R3]\n"
103  "BL sub_FFB1BCF0\n"
104  "LDR R3, =0xC76C\n"
105  "LDR R0, =0x9C044\n"
106  "LDR R1, [R3]\n"
107  "BL sub_FFB1BCF0\n"
108  "BL sub_FFB27760\n"
109  "BL sub_FF8112B0\n"
110  "MOV R4, #0\n"
111  "MOV R3, R0\n"
112  "MOV R12, #0x800\n"
113  "LDR R0, =h_usrRoot\n" // !!!
114  "MOV R1, #0x4000\n"
115  );
116 // "LDR R2, =0xCC6B0\n" // !!! 0x9C6B0 + 0x30000 MEMISOSIZE!!!
117 // "LDR R2, =0x18A6B0\n" // !!! Increased size !!! 0x9C6B0+0x1ae000= 0x24A6B0-0x18A6B0=786432
118  asm volatile (
119  "LDR R2, =new_sa\n"
120  "LDR R2, [R2]\n"
121  );
122  asm volatile (
123  "STR R12, [SP]\n"
124  "STR R4, [SP,#4]\n"
125  "BL sub_FFB1FE20\n"
126  "ADD SP, SP, #8\n"
127  "LDMFD SP!, {R4,PC}\n"
128  );
129 }
void h_usrRoot ( )

Definiert in Zeile 132 der Datei boot.c.

133 {
134  asm volatile
135  (
136  "STMFD SP!, {R4,R5,LR}\n"
137  "MOV R5, R0\n"
138  "MOV R4, R1\n"
139  "BL sub_FF8119D4\n"
140  "MOV R1, R4\n"
141  "MOV R0, R5\n"
142  "BL sub_FFB1406C\n"
143  "MOV R1, R4\n"
144  "MOV R0, R5\n"
145  "BL sub_FFB14AE4\n"
146  "BL sub_FF811708\n"
147  "MOV R0, #0x32\n"
148  "BL sub_FFB16A88\n" // selectInit
149  );
150 
151  asm volatile
152  (
153  "BL sub_FF811A14\n" //ios_tty_Init
154  "BL sub_FF8119F8\n"
155  "BL sub_FF811A40\n"
156  "BL sub_FFB16348\n"
157  "BL sub_FF8119C8\n"
158  );
159 
162 
163  drv_self_hide();
164 
165  asm volatile (
166  "LDMFD SP!, {R4,R5,LR}\n"
167  "B sub_FF811370\n"
168  );
169 }

Variablen-Dokumentation

const char* const new_sa = &_end

Definiert in Zeile 6 der Datei boot.c.

long wrs_kernel_bss_end
long wrs_kernel_bss_start