|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Mini-os with Lua
Hi John,
We are currently working on getting Mini-os to work on 64 bit
architecture and doing some debugging work. You therefore don't have to
worry about semantic changes (for example changing the scheduler).
Small code base and simplicity of Mini-os makes it suitable for projects
like yours (we have a few of them here as well). From the Mini-os
development point of view the more stress tests should expose more bugs.
So please keep in touch (write to me directly), especially if you
experience any Mini-os misbehaviors.
Cheers
Gregor
John D. Ramsdell wrote:
Ewan Mellor <ewan@xxxxxxxxxxxxx> writes:
Thanks for that patch to mini-os. The file in question was actually
removed from xen-unstable a couple of weeks ago, so there's no
problem any longer!
The reason I was running the mini-os, is that I was thinking about
using it to implement programs that run in lightweight virtual
machines. It appears from your note that mini-os is changing, and I
hope it is not changing in a way that is incompatible with the way I
in which I had hoped to use it. Let me describe my plan.
I would like to run reactive programs in the style used by old
distributed memory parallel processors. In this style, a program
registers handlers for events, and then exits. Actual computation
occurs in a thread created by the operating system to handle an event.
Each thread is required to be short lived, so the cooperative
scheduler that is in the mini-os is appropriate for this programming
model.
To ease the programming task, I would like to implement the handlers
in Lua <http://www.lua.org>, a scripting language popular with the
small device community. Lua is appropriate because it can be built so
that it performs no floating point operations, and its garbage
collector is incremental, so that pause times are small. This allows
it to be used with a reactive programming model inside the kernel.
The C library that is part of mini-os in inadequate for use with Lua,
however, one can build a cross-compiler that can do the job. To do
so, one downloads the sources for binutils, gcc, and newlib
<http://sources.redhat.com/newlib/>, and builds a cross-compiler for
the target i386-elf. In addition to linking ones program with libc,
and libm, one also uses libnosys, which stubs all system calls. I
built mini-os with the cross-compiler, and verified it runs in Xen. I
have also built Lua with it so as to ensure that all of its globals
are resolved by newlib.
Lua can be useful with stub routines for system calls, however, there
is one more support item it requires. It needs an allocator that
functions like realloc, or a good implementation of the sbrk system
call. Since mini-os contains an implementation of malloc and free,
hacking in support for realloc seems to be the best option to me.
The remaining step is to write C functions that expose hypercall
functionality inside of Lua. Since Lua is designed to be embedded
into C programs, this task should be easy. I was just about to start
writing these functions when you raised my concerns about mini-os's
direction. Where is it headed, and will it continue to provide the
kind of platform that supports reactive programming?
John
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|