summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kern/kernel.c2
-rw-r--r--kern/log.c12
2 files changed, 12 insertions, 2 deletions
diff --git a/kern/kernel.c b/kern/kernel.c
index 30dff08e..f41956e8 100644
--- a/kern/kernel.c
+++ b/kern/kernel.c
@@ -21,7 +21,6 @@
#include <kern/llsync.h>
#include <kern/log.h>
#include <kern/percpu.h>
-#include <kern/shell.h>
#include <kern/sleepq.h>
#include <kern/sref.h>
#include <kern/task.h>
@@ -52,7 +51,6 @@ kernel_main(void)
llsync_setup();
sref_setup();
vm_page_info();
- shell_start();
log_start();
#ifdef X15_RUN_TEST_MODULE
diff --git a/kern/log.c b/kern/log.c
index 6adc378b..a3b34f37 100644
--- a/kern/log.c
+++ b/kern/log.c
@@ -228,11 +228,13 @@ log_run(void *arg)
{
unsigned long flags, index, nr_overruns;
struct log_record record;
+ bool start_shell;
int error;
(void)arg;
nr_overruns = 0;
+ start_shell = true;
spinlock_lock_intr_save(&log_lock, &flags);
@@ -240,6 +242,16 @@ log_run(void *arg)
for (;;) {
while (index == cbuf_end(&log_cbuf)) {
+ /*
+ * Starting the shell after the log thread sleeps for the first
+ * time cleanly serializes log messages and shell prompt, making
+ * a clean ordered output.
+ */
+ if (start_shell) {
+ shell_start();
+ start_shell = false;
+ }
+
thread_sleep(&log_lock, &log_cbuf, "log_cbuf");
}