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

Re: A unikernel for building unikernels



On 5 Jan 2025, at 13:27, Hannes Mehnert <hannes@xxxxxxxxxxx> wrote:
> 
> happy new year to you all!

Same to you! :-)

> 
> I recently looked into the "embeddding the OCaml native toplevel into a 
> unikernel", and there are several issues with it:
> - it requires an assembler (since OCaml only generates assembly files) - not 
> sure if there's a native OCaml implementation,
> - it also requires a linker to convert the assembly into a shared library,
> - and finally it loads the shared library using dlopen (etc.) - which is not 
> available in a MirageOS unikernel setting.
> 

LLVM (via libclang) does have an integrated assembler, so you should (subject 
to writing a bunch of C++) be able to link that in to process the assembly.  
I've not looked into the status of the LLVM linkers in a few years though (lld 
vs gold). The dlopen use should be fairly straightforward to integrate with 
solo5 though; you may even able to just setup a static executable buffer that's 
reused for this, including W^X exclusion as there would never be a point where 
the same page is being executed and written too simultaneously.

best,
Anil




 


Rackspace

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