diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-02 09:12:39 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-02 09:12:39 +0100 |
commit | f08246e1976e3ae483c2568e4e510cb3f2b6e44d (patch) | |
tree | b4a7999be3d4dc10a52652824a3dde2cc767ed29 /extras/mini-os/kernel.c | |
parent | af8fc368d78db62f9f637e7e433d1a5027ef47b1 (diff) | |
download | xen-f08246e1976e3ae483c2568e4e510cb3f2b6e44d.tar.gz xen-f08246e1976e3ae483c2568e4e510cb3f2b6e44d.tar.bz2 xen-f08246e1976e3ae483c2568e4e510cb3f2b6e44d.zip |
Fix x86/64 version of Mini-OS. It encompasses the following:
a) 64-bit switch_to scheduler macro (by Aravindh Puthiyaparambil)
b) implements 64-bit hypervisor_callback
c) fixes thread creation issues (thread_starter used to perform
initialisation)
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/kernel.c')
-rw-r--r-- | extras/mini-os/kernel.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c index f6120f27d9..3ac572a035 100644 --- a/extras/mini-os/kernel.c +++ b/extras/mini-os/kernel.c @@ -35,6 +35,8 @@ #include <lib.h> #include <sched.h> #include <xenbus.h> +#include <xen/features.h> +#include <xen/version.h> /* * Shared page for communicating with the hypervisor. @@ -85,6 +87,26 @@ static void init_xs(void *ign) test_xenbus(); } + +u8 xen_features[XENFEAT_NR_SUBMAPS * 32]; + +void setup_xen_features(void) +{ + xen_feature_info_t fi; + int i, j; + + for (i = 0; i < XENFEAT_NR_SUBMAPS; i++) + { + fi.submap_idx = i; + if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0) + break; + + for (j=0; j<32; j++) + xen_features[i*32+j] = !!(fi.submap & 1<<j); + } +} + + /* * INITIAL C ENTRY POINT. */ @@ -127,7 +149,9 @@ void start_kernel(start_info_t *si) printk(" flags: 0x%x\n", (unsigned int)si->flags); printk(" cmd_line: %s\n", si->cmd_line ? (const char *)si->cmd_line : "NULL"); + printk(" stack: %p-%p\n", stack, stack + 8192); + setup_xen_features(); /* Init memory management. */ init_mm(); @@ -146,7 +170,7 @@ void start_kernel(start_info_t *si) /* Init XenBus from a separate thread */ create_thread("init_xs", init_xs, NULL); - + /* Everything initialised, start idle thread */ run_idle_thread(); } |