Hello! I''ve created a patch to get the mini-os to compile in Xen-unstable. The patch is pretty big, but this is mostly because I''ve replaced hypervisor.h with the hypercalls.h header file from Linux (which seems easier to maintain anyway). I''ve ignored X86_64. I also had to disable some code in mini-os/xenbus/xenbus_xs.c since XS_WATCH_ACK is no longer available, I''m not sure what the proper fix would be. With the patch, the mini-os is possible to compile, but unfortunately crashes during startup. Specifically, __sti() called from kernel.c:105 causes a page fault in os.h:83 #define __sti() \ do { \ vcpu_info_t *_vcpu; \ barrier(); \ _vcpu = &HYPERVISOR_shared_info->vcpu_data[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 0; \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ force_evtchn_callback(); \ } while (0) The problem is the access _vcpu->evtchn_upcall_mask = 0;. (smp_processor_id is defined to 0). // Simon _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Simon Kagstrom
2005-Oct-25 10:11 UTC
Re: [Xen-devel] [PATCH] getting mini-os to compile again
On 2005-10-25, 11:39, Simon Kagstrom wrote:> Hello! > > I''ve created a patch to get the mini-os to compile in Xen-unstable. The patch > is pretty big, but this is mostly because I''ve replaced hypervisor.h with the > hypercalls.h header file from Linux (which seems easier to maintain > anyway). I''ve ignored X86_64. > > I also had to disable some code in mini-os/xenbus/xenbus_xs.c since > XS_WATCH_ACK is no longer available, I''m not sure what the proper fix would > be. > > With the patch, the mini-os is possible to compile, but unfortunately crashes > during startup. Specifically, __sti() called from kernel.c:105 causes a page > fault in os.h:83I''ll reply myself on this. This problem turned out to be the __pte() definition in kernel.c which seems incorrect to me - see patch below. Then the mini-os gets slightly further, but seems to crash in the xenbus code (but again, I don''t really know how to fix that). // Simon diff -r e47f04c55eb1 extras/mini-os/kernel.c --- a/extras/mini-os/kernel.c Mon Oct 24 11:57:37 2005 +++ b/extras/mini-os/kernel.c Tue Oct 25 12:09:32 2005 @@ -61,7 +61,7 @@ extern char shared_info[PAGE_SIZE]; -#define __pte(x) ((pte_t) { (0) } ) +#define __pte(x) ((pte_t) { (x) } ) static shared_info_t *map_shared_info(unsigned long pa) { @@ -88,6 +88,8 @@ /* Grab the shared_info pointer and put it in a safe place. */ HYPERVISOR_shared_info = map_shared_info(start_info.shared_info); + + printf("si: 0x%08x, Hs: 0x%08x, Hsvcpu: 0x%08x", si, HYPERVISOR_shared_info, &(HYPERVISOR_shared_info->vcpu_data)); /* Set up event and failsafe callback addresses. */ #ifdef __i386__ @@ -150,5 +152,5 @@ void do_exit(void) { printk("do_exit called!\n"); - for ( ;; ) HYPERVISOR_shutdown(); + for ( ;; ) HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash); } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Oct-27 16:45 UTC
Re: [Xen-devel] [PATCH] getting mini-os to compile again
On 25 Oct 2005, at 10:39, Simon Kagstrom wrote:> I''ve created a patch to get the mini-os to compile in Xen-unstable. > The patch > is pretty big, but this is mostly because I''ve replaced hypervisor.h > with the > hypercalls.h header file from Linux (which seems easier to maintain > anyway). I''ve ignored X86_64.Thanks!> I also had to disable some code in mini-os/xenbus/xenbus_xs.c since > XS_WATCH_ACK is no longer available, I''m not sure what the proper fix > would > be.I haven;t looked, but I think xenbus_xs.c is pretty OS-agnostic and the one in minios is probably straight out of linux-2.6-xen-sparse? So a starting point woul dbe to take a fresh snap from the linux sparse tree and make it build. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel