sched: add kernel thread creation and SMP-aware thread scheduling
This commit is contained in:
11
init/main.c
11
init/main.c
@@ -19,6 +19,15 @@ void print_kernel_banner(void)
|
||||
printk("Socks kernel version " BUILD_ID);
|
||||
}
|
||||
|
||||
void background_thread(void)
|
||||
{
|
||||
printk("background_thread() running on processor %u", this_cpu());
|
||||
while (1) {
|
||||
milli_sleep(500);
|
||||
printk("tock");
|
||||
}
|
||||
}
|
||||
|
||||
void kernel_init(uintptr_t arg)
|
||||
{
|
||||
ml_init(arg);
|
||||
@@ -38,6 +47,8 @@ void kernel_init(uintptr_t arg)
|
||||
|
||||
run_all_tests();
|
||||
|
||||
create_kernel_thread(background_thread);
|
||||
|
||||
while (1) {
|
||||
milli_sleep(1000);
|
||||
printk("tick");
|
||||
|
||||
Reference in New Issue
Block a user