All Projects → mirage → Mirage Skeleton

mirage / Mirage Skeleton

Licence: unlicense
Examples of simple MirageOS apps

Programming Languages

ocaml
1615 projects

Projects that are alternatives of or similar to Mirage Skeleton

Botui Examples
Some examples on how to use BotUI
Stars: ✭ 136 (-19.05%)
Mutual labels:  examples
Oatpp Examples
List of example projects of how to use oat++ framework
Stars: ✭ 155 (-7.74%)
Mutual labels:  examples
Pharo Wiki
Wiki related to the Pharo programming language and environment.
Stars: ✭ 161 (-4.17%)
Mutual labels:  examples
Fastfiles
Fastlane fastfile examples and custom actions
Stars: ✭ 138 (-17.86%)
Mutual labels:  examples
Ws Examples
Examples of using github.com/gobwas/ws
Stars: ✭ 148 (-11.9%)
Mutual labels:  examples
Ansible Vagrant Examples
Ansible examples using Vagrant to deploy to local VMs.
Stars: ✭ 1,913 (+1038.69%)
Mutual labels:  examples
Thinking In Spring Boot Samples
小马哥书籍《Spring Boot 编程思想》示例工程
Stars: ✭ 1,725 (+926.79%)
Mutual labels:  examples
Learngganimate
A living, breathing community exploration of the gganimate R package. A rOpenSci #ozunconf2018 project
Stars: ✭ 165 (-1.79%)
Mutual labels:  examples
Qubes Mirage Firewall
A Mirage firewall VM for QubesOS
Stars: ✭ 149 (-11.31%)
Mutual labels:  unikernel
Jitfromscratch
Example project from my talks in the LLVM Social Berlin and C++ User Group
Stars: ✭ 158 (-5.95%)
Mutual labels:  examples
Examples
DC/OS examples
Stars: ✭ 139 (-17.26%)
Mutual labels:  examples
Examples
Repo containing example apps made with NodeGui and React NodeGui
Stars: ✭ 144 (-14.29%)
Mutual labels:  examples
Cypress Example Recipes
Various recipes for testing common scenarios with Cypress
Stars: ✭ 2,485 (+1379.17%)
Mutual labels:  examples
Terragrunt Infrastructure Modules Example
A repo used to show examples file/folder structures you can use with Terragrunt and Terraform
Stars: ✭ 135 (-19.64%)
Mutual labels:  examples
Examples
Examples of Mock Service Worker usage with various frameworks and libraries.
Stars: ✭ 163 (-2.98%)
Mutual labels:  examples
Golang For Nodejs Developers
Examples of Golang compared to Node.js for learning
Stars: ✭ 2,698 (+1505.95%)
Mutual labels:  examples
Icmc Usp
"If You're Going Through Hell, Keep Going" - Winston Churchill 🐢 🐢 🐢
Stars: ✭ 156 (-7.14%)
Mutual labels:  examples
M5 Productexamplecodes
All example codes of products supplied by M5Stack have been collected in this reposity.
Stars: ✭ 165 (-1.79%)
Mutual labels:  examples
Examples
Examples for go-flutter
Stars: ✭ 164 (-2.38%)
Mutual labels:  examples
Dotnet Console Games
Game examples implemented in .NET console applications primarily for educational purposes.
Stars: ✭ 157 (-6.55%)
Mutual labels:  examples

Build Status

mirage-skeleton

This repository is a collection of tutorial code referred to from the Mirage website, example code for using specific devices like filesystems and networks, and higher-level applications like DHCP, DNS, and Web servers.

  • tutorial/ contains the tutorial content.
  • device-usage/ contains examples showing specific devices.
  • applications/ contains the higher-level examples, which may use several different devices.

Prerequisites

  • Install latest OPAM (at least 2.0.0), following instructions at https://opam.ocaml.org/

  • Install the mirage package with OPAM, updating your package first if necessary:

    $ opam update -u
    $ opam install mirage
    $ eval `opam config env`
  • Please ensure that your Mirage command-line version is at least 3.7.0 before proceeding:
    $ mirage --version
    3.7.0

Trivial example

You can check that your build environment is working and get a feel for the normal workflow by trying to compile the noop application.

    $ cd tutorials/noop
    $ mirage configure -t unix # initial setup for UNIX backend
    $ make depend # install dependencies
    $ make # build the program
    $ ./noop # run the program

Note that in the general case, you may need to specify more options at the mirage configure stage. You can find out about them with mirage configure --help. For example, you may need to specify what networking method should be used, with, e.g., --net socket or --net direct at the mirage configure stage.

Configure, Build, Run

Each unikernel lives in its own directory, and can be configured, built, and run from that location. For example:

    $ cd applications/static_website_tls
    $ mirage configure -t unix # initial setup for UNIX backend
    $ make depend # install dependencies
    $ make # build the program
    $ ./https # run the program

If you want to clean up mirage's artifacts after building, mirage clean will do the trick:

    $ cd applications/static_website_tls
    $ mirage clean

There is also a top-level Makefile at the root of this repository with convenience functions for configuring, building, and running all of the examples in one step.

    $ make all                   ## equivalent to ...
    $ make configure build
    $ make clean

Details

The Makefile simply invokes sample-specific sample/Makefile. Each of those invokes the mirage command-line tool to configure, build and run the sample, passing flags and environment as directed. The mirage command-line tool assumes that the OPAM package manager is present and is used to manage installation of an OCaml dependencies.

The mirage command-line tool supports four commands, each of which either uses config.ml in the current directory or supports passing a config.ml directly.

To configure a unikernel before building:

    $ mirage configure -t [hvt|virtio|qubes|macosx|unix|xen|genode|muen|spt]

The boot target is selected via the -t flag. The default target is unix. Depending on what devices are present in config.ml, there may be additional configuration options for the unikernel. To list the options,

Note: the option hvt needs mirage ≥ 3.2.0 - which you can get via opam 2

    $ mirage help configure

and see the section labeled UNIKERNEL PARAMETERS.

To install dependencies

After running mirage configure:

    $ make depend

to install the list of dependencies discovered in the mirage configure phase.

To build a unikernel:

    $ make

The output will be created next to the config.ml file used.

To run a unikernel:

The mechanics of running the generated artifact will be dependent on the backend used. For details, see solo5's readme for hvt, virtio, etc., the qubes-test-mirage repository's readme for Qubes, or the MirageOS website instructions on booting Xen unikernels.

For the Macosx and Unix backends, running as a normal process should suffice.

For summaries by backend that assume the hello example, see below:

Unix:

    $ cd hello
    $ mirage configure -t unix
    $ make depend
    $ make
    $ ./hello

Xen:

    $ cd hello
    $ mirage configure -t xen
    $ make depend
    $ make
    $ sudo xl create xen.xl -c

Hvt:

    $ cd hello
    $ mirage configure -t hvt
    $ make depend
    $ make
    $ solo5-hvt hello.hvt

Virtio:

    $ cd hello
    $ mirage configure -t virtio
    $ make depend
    $ make
    $ solo5-virtio-run ./https.virtio

Macosx:

    $ cd hello
    $ mirage configure -t macosx
    $ make depend
    $ make
    $ ./hello

Qubes:

Some specific setup in the QubesOS manager is necessary to be able to easily run MirageOS unikernels -- please see the qubes-test-mirage readme for details.

    $ cd hello
    $ mirage configure -t qubes
    $ make depend
    $ make
    $ ~/test-unikernel hello.xen unikernel-test-vm

To clean up after building a unikernel:

    $ make clean
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].