Changeset 49eec93 in mainline
- Timestamp:
- 2008-06-03T14:51:05Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b84aaba
- Parents:
- 8ed4014
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
r8ed4014 r49eec93 154 154 155 155 interrupts_enable(); 156 156 157 /* 158 * Create user tasks, load RAM disk images. 159 */ 157 160 count_t i; 161 thread_t *threads[CONFIG_INIT_TASKS]; 162 158 163 for (i = 0; i < init.cnt; i++) { 159 /* 160 * Run user tasks, load RAM disk images. 161 */ 164 if (init.tasks[i].addr % FRAME_SIZE) { 165 printf("init[%" PRIc "].addr is not frame aligned", i); 166 continue; 167 } 168 169 threads[i] = thread_create_program( 170 (void *) init.tasks[i].addr, "uspace"); 162 171 163 if (init.tasks[i].addr % FRAME_SIZE) { 164 printf("init[%d].addr is not frame aligned", i); 165 continue; 166 } 167 168 task_t *utask = task_run_program((void *) init.tasks[i].addr, 169 "uspace"); 170 171 if (utask) { 172 if (threads[i] != NULL) { 172 173 /* 173 174 * Set capabilities to init userspace tasks. 174 175 */ 175 cap_set( utask, CAP_CAP | CAP_MEM_MANAGER |176 cap_set(threads[i]->task, CAP_CAP | CAP_MEM_MANAGER | 176 177 CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG); 177 178 178 if (!ipc_phone_0) 179 ipc_phone_0 = & utask->answerbox;179 if (!ipc_phone_0) 180 ipc_phone_0 = &threads[i]->task->answerbox; 180 181 } else { 181 182 int rd = init_rd((rd_header_t *) init.tasks[i].addr, … … 183 184 184 185 if (rd != RE_OK) 185 printf("Init binary %zd not used, error code %d.\n", i, rd); 186 } 187 } 188 186 printf("Init binary %" PRIc " not used, error code %d.\n", i, rd); 187 } 188 } 189 190 /* 191 * Run user tasks with reasonable delays 192 */ 193 for (i = 0; i < init.cnt; i++) { 194 if (threads[i] != NULL) { 195 thread_usleep(50000); 196 thread_ready(threads[i]); 197 } 198 } 189 199 190 200 if (!stdin) {
Note:
See TracChangeset
for help on using the changeset viewer.