Changes in kernel/generic/src/main/kinit.c [a4e23f8c:221c9ec] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
ra4e23f8c r221c9ec 69 69 #include <str.h> 70 70 #include <sysinfo/stats.h> 71 #include <sysinfo/sysinfo.h>72 71 #include <align.h> 73 72 … … 117 116 * Just a beautification. 118 117 */ 119 thread = thread_create(kmp, NULL, TASK, 120 THREAD_FLAG_UNCOUNTED, "kmp"); 118 thread = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true); 121 119 if (thread != NULL) { 122 thread_wire(thread, &cpus[0]); 120 irq_spinlock_lock(&thread->lock, false); 121 thread->cpu = &cpus[0]; 122 irq_spinlock_unlock(&thread->lock, false); 123 123 thread_ready(thread); 124 124 } else … … 134 134 135 135 for (i = 0; i < config.cpu_count; i++) { 136 thread = thread_create(kcpulb, NULL, TASK, 137 THREAD_FLAG_UNCOUNTED, "kcpulb"); 136 thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true); 138 137 if (thread != NULL) { 139 thread_wire(thread, &cpus[i]); 138 irq_spinlock_lock(&thread->lock, false); 139 thread->cpu = &cpus[i]; 140 irq_spinlock_unlock(&thread->lock, false); 140 141 thread_ready(thread); 141 142 } else … … 151 152 152 153 /* Start thread computing system load */ 153 thread = thread_create(kload, NULL, TASK, THREAD_FLAG_NONE, 154 "kload"); 154 thread = thread_create(kload, NULL, TASK, 0, "kload", false); 155 155 if (thread != NULL) 156 156 thread_ready(thread); … … 163 163 * Create kernel console. 164 164 */ 165 thread = thread_create(kconsole_thread, NULL, TASK, 166 THREAD_FLAG_NONE, "kconsole"); 165 thread = thread_create(kconsole_thread, NULL, TASK, 0, "kconsole", false); 167 166 if (thread != NULL) 168 167 thread_ready(thread); … … 172 171 #endif /* CONFIG_KCONSOLE */ 173 172 174 /*175 * Store the default stack size in sysinfo so that uspace can create176 * stack with this default size.177 */178 sysinfo_set_item_val("default.stack_size", NULL, STACK_SIZE_USER);179 180 173 interrupts_enable(); 181 174 … … 186 179 program_t programs[CONFIG_INIT_TASKS]; 187 180 188 // FIXME: do not propagate arguments through sysinfo189 // but pass them directly to the tasks190 for (i = 0; i < init.cnt; i++) {191 const char *arguments = init.tasks[i].arguments;192 if (str_length(arguments) == 0)193 continue;194 if (str_length(init.tasks[i].name) == 0)195 continue;196 size_t arguments_size = str_size(arguments);197 198 void *arguments_copy = malloc(arguments_size, 0);199 if (arguments_copy == NULL)200 continue;201 memcpy(arguments_copy, arguments, arguments_size);202 203 char item_name[CONFIG_TASK_NAME_BUFLEN + 15];204 snprintf(item_name, CONFIG_TASK_NAME_BUFLEN + 15,205 "init_args.%s", init.tasks[i].name);206 207 sysinfo_set_item_data(item_name, NULL, arguments_copy, arguments_size);208 }209 210 181 for (i = 0; i < init.cnt; i++) { 211 182 if (init.tasks[i].paddr % FRAME_SIZE) { … … 230 201 str_cpy(namebuf + INIT_PREFIX_LEN, 231 202 TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name); 232 203 233 204 /* 234 205 * Create virtual memory mappings for init task images. … … 250 221 CAP_IO_MANAGER | CAP_IRQ_REG); 251 222 252 if (!ipc_phone_0) {223 if (!ipc_phone_0) 253 224 ipc_phone_0 = &programs[i].task->answerbox; 254 /*255 * Hold the first task so that the256 * ipc_phone_0 remains a valid pointer257 * even if the first task exits for258 * whatever reason.259 */260 task_hold(programs[i].task);261 }262 225 } 263 226 … … 273 236 init_rd((void *) init.tasks[i].paddr, init.tasks[i].size); 274 237 } else 275 printf("init[%zu]: Init binary load failed " 276 "(error %d, loader status %u)\n", i, rc, 277 programs[i].loader_status); 238 printf("init[%zu]: Init binary load failed (error %d)\n", i, rc); 278 239 } 279 240
Note:
See TracChangeset
for help on using the changeset viewer.