[kernel] properly initialize the default thread context very early to avoid crash on pixies
diff --git a/kernel/main.c b/kernel/main.c
index b7ab4ff..16a4099 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -58,6 +58,9 @@
void kmain(void) __NO_RETURN __EXTERNALLY_VISIBLE;
void kmain(void)
{
+ // get us into some sort of thread context
+ thread_init_early();
+
// early arch stuff
arch_early_init();
diff --git a/kernel/thread.c b/kernel/thread.c
index 1a23478..eeccdd6 100644
--- a/kernel/thread.c
+++ b/kernel/thread.c
@@ -409,7 +409,7 @@
exit_critical_section();
}
-void thread_init(void)
+void thread_init_early(void)
{
int i;
@@ -432,6 +432,10 @@
current_thread = t;
}
+void thread_init(void)
+{
+}
+
void thread_set_name(const char *name)
{
strlcpy(current_thread->name, name, sizeof(current_thread->name));