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

Re: [MirageOS-devel] Including a C Library in a Mirage Xen Kernel

> Current solution: fork mirage-platform and add your library directly into
> the repository (there are several other stubs in kernel/ that use the OCaml
> headers, such as checksum_stubs.c).  You can still distribute your fork via
> a custom OPAM remote that overrides mirage-platform-xen.

Thanks, Anil.  I will just include my dependencies in mirage-platform
for the time being since I've already forked it as you described.

I did have to add a few files from upstream dietlibc that I needed---I
had to upgrade "stdint.h" as it was missing some definitions, and
included the inet headers (to get some socket #define's and inet_nto*).

> Medium term solution: I'm splitting out the dietlibc dependency from the
> MiniOS kernel, and merging us back to the MiniOS version found in Xen
> upstream.  I'd like to bolt on a libm and libc on top of this, but I need
> to investigate the latest in embedded cross-compilation, since this also
> needs to support ARM (and more experimentally, MIPS64) as well as x86.
> Anyone have any recommendations in this space?

Putting my embedded systems developer hat on and throwing my
"get-this-library-working-asap" role under the bus a bit, I think it'd
be reasonable for Mirage to supply a pretty minimal libc if you're
targeting an embedded environment, but it'd be nice to have a
compatibility path for folks that need a richer set of libc functions.

I'm still getting up to speed on all the Ocaml build tools, but it seems
like the hurdle to getting embedded-style cross-compilation working is
figuring out how to share toolchain configuration between ocamlfind,
ocamlbuild, opam, mirari, and plain old Makefiles.  Currently it's
pretty easy to end up accidentally using the host compiler, libraries, etc.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

MirageOS-devel mailing list



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