aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/kernel.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-24 10:47:48 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-24 10:47:48 +0100
commitc7b965a01c79f34586562d1e2b8eda2c00449bb2 (patch)
tree9ed2a204c58fa4de41a0da4adb14d30a4ef7832f /extras/mini-os/kernel.c
parent2acf021310aea3b5b45a82ba0c928cfe6738495a (diff)
downloadxen-c7b965a01c79f34586562d1e2b8eda2c00449bb2.tar.gz
xen-c7b965a01c79f34586562d1e2b8eda2c00449bb2.tar.bz2
xen-c7b965a01c79f34586562d1e2b8eda2c00449bb2.zip
Fix mini-os xenbus.
From: Grzegorz Milos <gm281@cam.ac.uk> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'extras/mini-os/kernel.c')
-rw-r--r--extras/mini-os/kernel.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c
index 3bc7809ade..f6120f27d9 100644
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -35,7 +35,6 @@
#include <lib.h>
#include <sched.h>
#include <xenbus.h>
-#include "xenbus/xenbus_comms.h"
/*
* Shared page for communicating with the hypervisor.
@@ -76,7 +75,15 @@ static shared_info_t *map_shared_info(unsigned long pa)
}
-extern void init_console(void);
+void test_xenbus(void);
+
+/* Do initialisation from a thread once the scheduler's available */
+static void init_xs(void *ign)
+{
+ init_xenbus();
+
+ test_xenbus();
+}
/*
* INITIAL C ENTRY POINT.
@@ -84,11 +91,13 @@ extern void init_console(void);
void start_kernel(start_info_t *si)
{
static char hello[] = "Bootstrapping...\n";
+
(void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(hello), hello);
/* Copy the start_info struct to a globally-accessible area. */
+ /* WARN: don't do printk before here, it uses information from
+ shared_info. Use xprintk instead. */
memcpy(&start_info, si, sizeof(*si));
-
/* Grab the shared_info pointer and put it in a safe place. */
HYPERVISOR_shared_info = map_shared_info(start_info.shared_info);
@@ -120,28 +129,24 @@ void start_kernel(start_info_t *si)
si->cmd_line ? (const char *)si->cmd_line : "NULL");
- /*
- * If used for porting another OS, start here to figure out your
- * guest os entry point. Otherwise continue below...
- */
- /* init memory management */
+ /* Init memory management. */
init_mm();
- /* set up events */
+ /* Set up events. */
init_events();
- /* init time and timers */
+ /* Init time and timers. */
init_time();
- /* init the console driver */
+ /* Init the console driver. */
init_console();
-
- /* init scheduler */
+
+ /* Init scheduler. */
init_sched();
-
- /* init xenbus */
- xs_init();
-
+
+ /* Init XenBus from a separate thread */
+ create_thread("init_xs", init_xs, NULL);
+
/* Everything initialised, start idle thread */
run_idle_thread();
}
@@ -156,6 +161,6 @@ void start_kernel(start_info_t *si)
void do_exit(void)
{
- printk("do_exit called!\n");
+ printk("Do_exit called!\n");
for ( ;; ) HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
}