Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision ed7e057b64d471ad72ea909cf21ef60835379064)
+++ kernel/generic/src/main/main.c	(revision c1eaec452eea24d23cfcba31035c7fa507f2a011)
@@ -287,5 +287,6 @@
 	 * starting the thread of kernel threads.
 	 */
-	scheduler_run();
+	current_copy(CURRENT, (current_t *) CPU_LOCAL->stack);
+	context_replace(scheduler_run, CPU_LOCAL->stack, STACK_SIZE);
 	/* not reached */
 }
@@ -327,6 +328,4 @@
 	ARCH_OP(post_cpu_init);
 
-	current_copy(CURRENT, (current_t *) CPU_LOCAL->stack);
-
 	/*
 	 * If we woke kmp up before we left the kernel stack, we could
@@ -334,4 +333,5 @@
 	 * switch to this cpu's private stack prior to waking kmp up.
 	 */
+	current_copy(CURRENT, (current_t *) CPU_LOCAL->stack);
 	context_replace(main_ap_separated_stack, CPU_LOCAL->stack, STACK_SIZE);
 	/* not reached */
