[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] MirageOS KVM Development



On 19 Aug 2014, at 18:16, Jon Ludlam <jjl25@xxxxxxxxx> wrote:

> On 19/08/14 14:58, Anil Madhavapeddy wrote:
>> On 19 Aug 2014, at 08:54, Bill Gercken <bgercken@xxxxxxxxx> wrote:
>> 
>>> Hello,
>>> 
>>> Is anybody actively working on support for KVM?
>>> 
>>> We are in a situation where we need to deploy to both Xen and KVM and I 
>>> would love to be able to create unikernel applications that can be compiled 
>>> for both environments.
>>> 
>> KVM is not specifically being worked on at this time, but we'd love to hear 
>> from anyone that would like to contribute towards the effort.  There have 
>> been several recent developments to make this easier in Mirage 2:
>> 
>> - the MiniOS library is now picked up from an external package
>> - this library is in sync with the Xen development tree (should be part of 
>> Xen 4.5) and is multiarch (x86_64/x86_32 and ARM).
>> - TODO: add a HVM boot mode to upstream MiniOS to let it boot in Xen 
>> hardware virt mode (Jon Ludlam had some patches against an earlier MiniOS 
>> that did this).
> 
> Mostly what I did was forward-port some earlier patches by Dave Scott.
> The branch is here: https://github.com/jonludlam/mirage-platform/tree/hvm.
> 
> What we did back then was use Pure64 to bootstrap, which leaves you in
> an environment all set up, so we just skipped out some of the mini-os
> setup. I now think it would be much better to do a full-on multiboot
> compliant kernel. I suspect it's actually relatively straightforward for
> Xen, since all we really need to do is set up the memory map (parsing
> e820 & co.) - I don't think we need to worry about interrupts (I think)
> as that can all be done via 'block domain' calls as we do with PV (as
> hvmloader does). For KVM you'd presumably need to do a bit more with the
> IDTs and making interrupt routines and whatnot.
> 
> Having said that, it'd be really nice to do the interrupts stuff;
> writing some nice type-safe PCI drivers would be fun :-)

For this we might be able to share some code with ‘snowflake OS’:

https://code.google.com/p/snowflake-os/

The code looks interesting, for example:

kernel djs$ ls *.mli
DMA.mli                         interrupts.mli
ELF.mli                         ircTypes.mli
ICH0.mli                        keyboard.mli
IDE.mli                         linkerTest.mli
PCI.mli                         multiboot.mli
asm.mli                         networkProtocolStack.mli
audioMixer.mli                  networkStack.mli
blockIO.mli                     objectFile.mli
debug.mli                       partitions.mli
deviceManager.mli               realTek8139.mli
dhcpClient.mli                  sb16.mli
e1000.mli                       snowflake.mli
elfLinking.mli                  tarFile.mli
elfParsing.mli                  trie.mli
elfPrinting.mli                 tulip.mli
elfTypes.mli                    vga.mli

kernel djs$ grep probe PCI*
PCI.ml:let probe bus device funct =
PCI.ml:let probe_bus () =
PCI.ml:                                 list := probe i j 0 :: !list
PCI.mli:val probe : int -> int -> int -> device
PCI.mli:val probe_bus : unit -> device list

Cheers,
Dave

> 
> Jon
> 
> 
>> After this, KVM support is pretty easy; it just needs the addition of virtio 
>> drivers in OCaml, which isn't a complex task.
>> 
>> -anil
>> _______________________________________________
>> MirageOS-devel mailing list
>> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
>> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
> 
> 
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.