WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] caml stubdom crashes

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] caml stubdom crashes
From: Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
Date: Thu, 02 Apr 2009 15:38:34 +0100
Delivery-date: Thu, 02 Apr 2009 07:38:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (X11/20090105)
Hello ocaml minios stubdomain experts (that's narrowed down the list somewhat!)

I've been playing with the caml version of the "hello world" example stubdomain that can be found in xen-unstable.hg/stubdom/caml/.

If I make the following trivial modification to stubdom/caml/hello.ml the stub domain page faults. According to addr2line the page fault is in ungetc.c:0.

--- a/stubdom/caml/hello.ml     Mon Mar 30 11:42:16 2009 +0100
+++ b/stubdom/caml/hello.ml     Thu Apr 02 15:15:45 2009 +0100
@@ -1,4 +1,6 @@
+let yr = 2009
+
 let main arg =
-  Printf.printf "Hello, world!\n%!."
+  Printf.printf "Hello, world %d!\n%!." yr

 let _ = Callback.register "main" main


Without the above change the stub domain runs as expected, i.e. it does not page fault.

I suspect the problem is that the caml-stubdom target in stubdom/caml/Makefile compiles stubdom/caml/hello.ml and links it with $(CAMLLIB)/libasmrun.a. But this is a library compiled for the development machine platform (linux-i386-glibc) not for the stubdomain platform (minios-i386-newlib).

Maybe the original hello.ml only worked through luck, and the fact that it used so very little of the ocaml language.

In order to run a non trivial ocaml application in a stubdomain (e.g. ocaml xenstored) do I need to port ocaml to minios-i386-newlib?

If so, I would really appreciate any pointers(*) on how to go about this as I am an ocaml newbie.

Regards,

Alex

(*) Although I understand you don't get pointers in ocaml. They would make it too easy to do what you want to do, which is probably the wrong thing. :)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel