Hi Michael,
Please forgive this delayed response - I've been trying to think of an
elegant and easy way of setting up a path between a gpio and unikernels.
There are no interfaces per-se dealing with direct io interaction.
However, you could try writing a device interface for the backend using
the block [1] or kv [2] signatures - the '-unix' give the unix
implementations.
There are gpio bindings [3][4] which you could look at and there's also
a good example of reading/wring to a gpio/memory in rpi-boot-ocaml [5]
Hope this helps and happy hacking!
Nick
[1] https://github.com/mirage/mirage-block/blob/master/src/mirage_block.mli
[2] https://github.com/mirage/mirage-kv/blob/master/src/mirage_kv.mli
[3] https://github.com/vbmithr/ocaml-gpio
[4] https://github.com/LaurentMazare/ocaml-rpi-gpio
[5] https://github.com/dbuenzli/rpi-boot-ocaml/blob/master/src/rpi.mli
On 19/02/2021 21:56, Michael Chiu wrote:
Hi Everyone,
I was hoping to get some help / advice on two related issues.
1. I'm new to both OCaml and MirageOS and am trying to figure out how to
access GPIO when targeting a unix backend. I've looked at all the
tutorials and have a basic understanding of how mirage works, but
couldn't find more in depth documentation on what's happening behind the
scenes, or what the available configuration options are for. Does the
unix backend have support for GPIO? Is there some documentation that I
haven't found? I'd appreciate some advice to better understanding
mirageOS.
2. I'm not too familiar with the build system in both ocaml and
mirageos, but I do know how to make a simple module package using dune.
I'm trying to get a custom module working in mirage but it's unclear to
tell the mirage toolchain about my custom module.
Any suggestions are appreciated, thanks in advance.