Rev 2131 | Rev 2265 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2131 | Rev 2260 | ||
---|---|---|---|
Line 79... | Line 79... | ||
79 | #include <macros.h> |
79 | #include <macros.h> |
80 | #include <adt/btree.h> |
80 | #include <adt/btree.h> |
81 | #include <console/klog.h> |
81 | #include <console/klog.h> |
82 | #include <smp/smp.h> |
82 | #include <smp/smp.h> |
83 | #include <ddi/ddi.h> |
83 | #include <ddi/ddi.h> |
- | 84 | #include <ddi/tasklet.h> |
|
84 | 85 | ||
85 | /** Global configuration structure. */ |
86 | /** Global configuration structure. */ |
86 | config_t config; |
87 | config_t config; |
87 | 88 | ||
88 | /** Initial user-space tasks */ |
89 | /** Initial user-space tasks */ |
Line 216... | Line 217... | ||
216 | btree_init(); |
217 | btree_init(); |
217 | as_init(); |
218 | as_init(); |
218 | page_init(); |
219 | page_init(); |
219 | tlb_init(); |
220 | tlb_init(); |
220 | ddi_init(); |
221 | ddi_init(); |
- | 222 | tasklet_init(); |
|
- | 223 | // tasklet_do(); |
|
221 | arch_post_mm_init(); |
224 | arch_post_mm_init(); |
222 | 225 | ||
223 | version_print(); |
226 | version_print(); |
224 | printf("kernel: %.*p hardcoded_ktext_size=%zdK, " |
227 | printf("kernel: %.*p hardcoded_ktext_size=%zdK, " |
225 | "hardcoded_kdata_size=%zdK\n", sizeof(uintptr_t) * 2, |
228 | "hardcoded_kdata_size=%zdK\n", sizeof(uintptr_t) * 2, |
Line 234... | Line 237... | ||
234 | slab_enable_cpucache(); |
237 | slab_enable_cpucache(); |
235 | 238 | ||
236 | printf("config.memory_size=%zdM\n", config.memory_size >> 20); |
239 | printf("config.memory_size=%zdM\n", config.memory_size >> 20); |
237 | printf("config.cpu_count=%zd\n", config.cpu_count); |
240 | printf("config.cpu_count=%zd\n", config.cpu_count); |
238 | cpu_init(); |
241 | cpu_init(); |
239 | 242 | ||
240 | calibrate_delay_loop(); |
243 | calibrate_delay_loop(); |
241 | clock_counter_init(); |
244 | clock_counter_init(); |
- | 245 | // tasklet_do(); |
|
242 | timeout_init(); |
246 | timeout_init(); |
243 | scheduler_init(); |
247 | scheduler_init(); |
244 | task_init(); |
248 | task_init(); |
245 | thread_init(); |
249 | thread_init(); |
246 | futex_init(); |
250 | futex_init(); |
- | 251 | ||
- | 252 | ||
247 | klog_init(); |
253 | klog_init(); |
248 | 254 | ||
249 | if (init.cnt > 0) { |
255 | if (init.cnt > 0) { |
250 | for (i = 0; i < init.cnt; i++) |
256 | for (i = 0; i < init.cnt; i++) |
251 | printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, |
257 | printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, |
Line 253... | Line 259... | ||
253 | init.tasks[i].size); |
259 | init.tasks[i].size); |
254 | } else |
260 | } else |
255 | printf("No init binaries found\n"); |
261 | printf("No init binaries found\n"); |
256 | 262 | ||
257 | ipc_init(); |
263 | ipc_init(); |
- | 264 | //tasklet_do(); |
|
258 | 265 | ||
259 | /* |
266 | /* |
260 | * Create kernel task. |
267 | * Create kernel task. |
261 | */ |
268 | */ |
262 | k = task_create(AS_KERNEL, "kernel"); |
269 | k = task_create(AS_KERNEL, "kernel"); |
Line 268... | Line 275... | ||
268 | */ |
275 | */ |
269 | t = thread_create(kinit, NULL, k, 0, "kinit", true); |
276 | t = thread_create(kinit, NULL, k, 0, "kinit", true); |
270 | if (!t) |
277 | if (!t) |
271 | panic("can't create kinit thread\n"); |
278 | panic("can't create kinit thread\n"); |
272 | thread_ready(t); |
279 | thread_ready(t); |
- | 280 | ||
- | 281 | tasklet_run_tasklet_thread(k); |
|
273 | 282 | ||
274 | /* |
283 | /* |
275 | * This call to scheduler() will return to kinit, |
284 | * This call to scheduler() will return to kinit, |
276 | * starting the thread of kernel threads. |
285 | * starting the thread of kernel threads. |
277 | */ |
286 | */ |