Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #8 from vbmithr/master

Update article install-opam to latest OPAM
  • Loading branch information...
commit 5123a20ae451187c62c41402dfe09dc4057ffd87 2 parents e095882 + 7ab8ae9
@avsm avsm authored
View
2  Makefile
@@ -12,7 +12,7 @@ build: src/dist/setup
cd src && mirari build www.conf $(XEN)
run:
- ./mir-www
+ cd src && ./mir-www
clean:
cd src && obuild clean
View
5 src/blog.ml
@@ -185,6 +185,11 @@ let dave = {
uri = Some "http://dave.recoil.org/";
email = Some "dave@recoil.org";
}
+let vb = {
+ Atom.name = "Vincent Bernardoff";
+ uri = Some "https://github.com/vbmithr";
+ email = Some "vb@luminar.eu.org";
+}
let rights = Some "All rights reserved by the author"
View
13 src/wiki.ml
@@ -352,6 +352,11 @@ let mort = {
uri = Some "http://mort.io/";
email = Some "mort@cantab.net";
}
+let vb = {
+ Atom.name = "Vincent Bernardoff";
+ uri = Some "https://github.com/vbmithr";
+ email = Some "vb@luminar.eu.org";
+}
let rights = Some "All rights reserved by the author"
@@ -409,16 +414,16 @@ let entries = [
categories = ["overview","usage"];
};
- { updated = date (2012, 06, 26, 17, 30);
- author = anil;
+ { updated = date (2013, 03, 10, 10, 30);
+ author = vb;
subject = "Installation";
body = File "install-opam.md";
permalink = "install";
categories = ["overview","usage"];
};
- { updated = date (2011, 04, 12, 12, 55);
- author = anil;
+ { updated = date (2013, 03, 10, 12, 55);
+ author = vb;
subject = "Hello Mirage World";
body = File "hello-world.md";
permalink = "hello-world";
View
1  tmpl/about.md
@@ -9,6 +9,7 @@
* *Balraj Singh*, University of Cambridge
* *Jon Crowcroft*, University of Cambridge, [cl.cam.ac.uk](http://www.cl.cam.ac.uk/~jac22/)
* *Steven Hand*, University of Cambridge, [cl.cam.ac.uk](http://www.cl.cam.ac.uk/~smh22/)
+* *Vincent Bernardoff*, Citrix Systems R&D
!!The Project
View
86 tmpl/wiki/hello-world.md
@@ -1,69 +1,83 @@
-First make sure you have followed the [installation instructions](/wiki/install) and have `mir-xen` in your `PATH`.
-Mirage uses `ocamlbuild` to build applications, with the `mir-*` scripts providing a convenient shell wrapper for each backend.
+First make sure you have followed the [installation
+instructions](/wiki/install). Mirage uses [Mirari](/blog/mirari) to
+automate the configuration and setup the build system necessary to
+build Mirage unikernels.
!!First Steps
To try out basic functionality and build a UNIX binary, do:
{{
- $ cd mirage.git/regress
- $ cat basic/sleep.ml
- $ mir-build unix-direct/basic/sleep.bin
- $ ./_build/unix-direct/basic/sleep.bin
+ $ git clone git://github.com/mirage/mirage-skeleton.git
+ $ cd mirage-skeleton/basic
+ $ cat basic/hello.ml
+ $ make
+ $ ./mir-hello
}}
-This will run a simple thread sleeping test that will output to the console.
-Now build a Xen version of this:
+This will just starts up a Xen kernel that prints "hello world" with a
+short pause between words. Now build a Xen version of this:
{{
- $ mir-build xen/basic/sleep.xen
+ $ opam switch 4.00.1+mirage-xen
+ $ eval `opam config env`
+ $ make clean && make
}}
-output will be in `_build/sleep.xen`, and you can boot it up with a config file like:
+This will create a symlink to `./dist/build/mir-hello/mir-hello.xen`,
+and you can boot it up with a config file like:
{{
- $ mir-build xen/regress/basic/sleep.xen
- $ cd _build/xen/basic
- $ cat > sleep.cfg
- name="sleep"
- memory=1024
- kernel="sleep.xen"
+ $ cat > hello.cfg
+ name="hello"
+ memory=128
+ kernel="mir-hello.xen"
+ vif=['bridge=xenbr0']
<control-d>
- $ sudo xm create -c sleep.cfg
+ # Use xm instead of xl if you are using Xen 4.1 or older
+ $ sudo xl create -c hello.cfg
}}
-You should see the same output on the Xen console as you did on the UNIX version you ran earlier.
-If you need more help getting a Xen kernel booted, try looking at the [Xen notes](/wiki/xen-boot) also.
+You should see the same output on the Xen console as you did on the
+UNIX version you ran earlier. If you need more help getting a Xen
+kernel booted, try looking at the [Xen notes](/wiki/xen-boot) also.
!!Networking
Mirage networking is present in the `Net` module and can compile in two modes:
-* A `direct` mode that works from the Ethernet layer (the `OS.Netif` module). On Xen, this is the virtual Ethernet driver, and on UNIX this requires the `tuntap` interface. You can link in this `Net` module by using the `xen` or `unix-direct` backends for Xen and UNIX respectively.
+* A `direct` mode that works from the Ethernet layer (the `OS.Netif`
+ module). On Xen, this is the virtual Ethernet driver, and on UNIX
+ this requires the `tuntap` interface. You can link in this `Net`
+ module by using the `xen` or `unix-direct` backends for Xen and UNIX
+ respectively.
+
+* A subset of the Net modules (`Flow`, `Channel` and `Manager`) are
+ available in 'socket' mode under UNIX. This maps the interfaces onto
+ POSIX sockets, enabling easy comparison with normal kernels. This is
+ only supported under UNIX via the `unix-socket` backend.
-* A subset of the Net modules (`Flow`, `Channel` and `Manager`) are available in 'socket' mode under UNIX. This maps the interfaces onto POSIX sockets, enabling easy comparison with normal kernels. This is only supported under UNIX via the `unix-socket` backend.
+When building a Mirage unikernel, `mirari` automatically include
+boilerplate code that uses the `Net.Manager` module. On the `direct`
+mode, your kernel will answer ping requests, as you can verify by
+issuing the following commands:
-Try out the ping server test by:
+Unix:
{{
- $ cd mirage.git/regress
- $ mir-build unix-direct/net/ping.bin
- $ sudo ./_build/unix-direct/net/ping.bin
+ $ opam switch 4.00.1+mirage-unix
+ $ eval `opam config env`
+ $ make
+ $ sudo ./mir-hello
$ ping 10.0.0.2
}}
-And similarly, the Xen version:
+Xen:
{{
- $ mir-build xen/net/ping.xen
- $ cd _build/xen/net
- $ cat > ping.cfg
- name="ping"
- memory=128
- kernel="ping.xen"
- vif=['bridge=xenbr0']
- <control-d>
- $ sudo xm create -c ping.cfg
+ $ opam switch 4.00.1+mirage-xen
+ $ eval `opam config env`
+ $ make
+ $ sudo xl create -c hello.cfg
<configure the bridge IP address>
$ telnet 10.0.0.2 8081
}}
-
View
105 tmpl/wiki/install-opam.md
@@ -1,33 +1,29 @@
Mirage consists of a set of OCaml libraries that link with a runtime, to form
either a standalone Xen operating system, or a normal UNIX binary. These
-libraries are managed via the [OPAM](http://github.com/OCamlPro/opam) package
+libraries are managed via the [OPAM](http://opam.ocamlpro.com) package
management tool. We will first introduce the basics of OPAM, and then describe
the libraries you need to get on with using Mirage.
OPAM manages simultaneous OCaml compiler and library installations. It tracks
library versions across upgrades, and will recompile dependencies automatically
-if they get out of date. There is a comprehensive
-[specification](https://github.com/OCamlPro/opam/raw/master/doc/specs/roadmap.pdf)
+if they get out of date. Please refer to OPAM
+[documentation](https://opam.ocamlpro.com)
if you want to know more, but we will cover the basics to get you started here.
!!Requirements
-Mirage has been tested on Debian Squeeze/Wheezy, Ubuntu Lucid and MacOS X
+Mirage has been tested on Archlinux, Debian Squeeze/Wheezy, Ubuntu Lucid and MacOS X
10.6/7. To compile the Xen backend, you *must* have a 64-bit Linux host.
32-bit is not supported at this time.
-*Debian*
+*Debian and Ubuntu*
{{
-$ sudo apt-get install build-essential ocaml ocaml-native-compilers camlp4-extra git
-$ git clone git://github.com/OCamlPro/opam.git
-$ cd opam && ./configure && make
-$ sudo make install
+$ echo "deb [arch=amd64] http://www.recoil.org/~avsm/ wheezy main" >> /etc/apt/sources.list
+$ apt-get update
+$ apt-get install opam
}}
-You can use a custom `BIN` to install into your home directory and not require
-root. Now skip to the next section to initialise OPAM.
-
*MacOS X*
We recommend the use of [Homebrew](http://github.com/mxcl/homebrew) to get
@@ -53,20 +49,20 @@ sources, so lets set up the two we will need for Mirage.
{{
$ opam init
-$ opam remote -add dev git://github.com/mirage/opam-repo-dev
+$ opam remote add mirage-dev git://github.com/mirage/opam-repo-dev
}}
-The first command initialises OPAM and adds the `default` repository to your
-package list. The second one is a `dev` remote that contains bleeding-edge
-packages that have not yet been released, but are directly available as git
-repositories. Whenever you issue an `opam update`, it will automatically
-attempt to upgrade those git repositories and recompile any dependencies as
-required.
+The first command initialises OPAM and adds the `default` repository
+to your package list. The second one is a `mirage-dev` remote that
+contains bleeding-edge packages that have not yet been released, but
+are directly available as git repositories. Whenever you issue an
+`opam update`, it will automatically attempt to upgrade those git
+repositories and recompile any dependencies as required.
{{
$ eval `opam config -env`
# add the above line to your ~/.profile
-$ opam --verbose install mirage-www
+$ opam install mirari
}}
You now need to append the path to the OPAM installation to your system `PATH`.
@@ -74,13 +70,14 @@ An appropriate shell fragment is output via `opam config -env`. If you add
the `eval` line to your login shell (usually `~/.profile`), it will automatically import
the correct PATH on every subsequent login.
-Finally, `opam install` will install the [CamlOnTheWeb](/wiki/cow) library
-and file system utilities, which are sufficient to build this website. To
-run it on your local machine, do:
+Finally, `opam install mirari` will install the [Mirari](/blog/mirari)
+library that will in turn download all the necessary dependencies and
+setup the build system necessary to build `mirage-www`. To run it on
+your local machine, do:
{{
$ git clone git://github.com/mirage/mirage-www
-$ cd mirage-www
+$ cd mirage-www
$ make
$ make run
}}
@@ -94,17 +91,18 @@ can use `opam switch` to swap between multiple cross-compilers. If you are on
64-bit Linux, lets get the Xen cross-compiler working.
{{
-$ opam switch -list
-$ opam switch 3.12.1+mirage-xen
-$ opam install mirage-www
+$ opam switch
+$ opam switch 4.00.1+mirage-xen
+$ opam install mirari
$ eval `opam config -env`
}}
-The `list` command will show you the available compilers. The `switch` will
-install the compiler into `~/.opam/xen`, with the compiler binaries in
-`~/.opam/xen/bin`, and any libraries installed into `~/.opam/xen/lib`. The
-`opam config` will detect the current compiler and output the correct PATH for
-your compiler installation.
+The `opam switch` command will show you the available compilers. The
+`switch` will install the compiler into `~/.opam/4.00.1+mirage-xen`,
+with the compiler binaries in `~/.opam/4.00.1+mirage-xen/bin`, and any
+libraries installed into `~/.opam/4.00.1+mirage-xen/lib`. The `opam
+config` will detect the current compiler and output the correct PATH
+for your compiler installation.
Now try to compile up a Xen version of this website, via:
{{
@@ -113,14 +111,16 @@ $ make clean
$ make
}}
-There will be a Xen microkernel in `./src/_build/main.xen`. __todo: how to run it__.
-An alternative
-is to compile a UNIX binary that uses the Mirage network stack
-instead of kernel sockets. This is the `unix-direct` compiler variant, and requires
-the `tuntap` interface to be available on the UNIX host.
+There will be a symbolic link to your Xen microkernel in the current
+working directory: learn how to run it [here](/wiki/xen-boot).
+
+An alternative is to compile a UNIX binary that uses the Mirage
+network stack instead of kernel sockets. This is the `unix-direct`
+compiler variant, and requires the `tuntap` interface to be available
+on the UNIX host.
{{
-$ opam switch 3.12.1+mirage-unix-direct
-$ opam install mirage-www
+$ opam switch 4.00.1+mirage-unix
+$ opam install mirari
$ eval `opam config -env`
}}
@@ -131,7 +131,7 @@ serve HTTP traffic on `10.0.0.2` via the tuntap interface.
The `opam upgrade` command will refresh all your remote repositories, and
recompile any outdated libraries. You will need to run this once per compiler
-installed, so switch between them
+installed, so switch between them.
If you run into any problems with OPAM, then first ask on the Mirage [mailing
list](/about), or report a [bug](http://github.com/OCamlPro/opam/issues). It
@@ -143,19 +143,30 @@ space.
There are two kinds of OPAM remote repositories: `stable` released versions of
packages that have version numbers, and `dev` packages that are retrieved via
-git (and eventually, other version control systems too).
+git or darcs (and eventually, other version control systems too).
-To develop a new package, fork the [mirage/opam-repo-dev](http://github.com/mirage/opam-repo-dev) repository on Github, clone it locally, and add it as an OPAM remote.
+To develop a new package, fork the
+[mirage/opam-repo-dev](http://github.com/mirage/opam-repo-dev)
+repository on Github, clone it locally, and add it as an OPAM remote.
{{
$ git clone git@github.com:avsm/opam-repo-dev
# remove the old dev remote
-$ opam remote -rm dev
+$ opam remote remove dev
$ cd opam-repo-dev
-$ opam remote -add dev .
+$ opam remote add dev .
}}
-This will configure your local checkout as a development remote, and OPAM will pull from it on every update.
-Each package lives in a directory named with the version, such as `packages/foo.0.1`, and requires three files inside it:
+
+This will configure your local checkout as a development remote, and
+OPAM will pull from it on every update. Each package lives in a
+directory named with the version, such as `packages/foo.0.1`, and
+requires three files inside it:
+
* `foo.0.1/url` : the URL to the distribution file or git directory
* `foo.0.1/opam` : the package commands to install and uninstall it
* `foo.0.1/descr` : a description of the library or application
-It's easiest to copy the files from an existing package and modify them to your needs (and read the [specification](https://github.com/OCamlPro/opam/raw/master/doc/specs/roadmap.pdf) for more information). Once you're done, add and commit the files, issue an `opam update`, and the new package should be available for installation or upgrade.
+
+It's easiest to copy the files from an existing package and modify
+them to your needs (and read the [doc](http://opam.ocamlpro.org) for
+more information). Once you're done, add and commit the files, issue
+an `opam update`, and the new package should be available for
+installation or upgrade.
Please sign in to comment.
Something went wrong with that request. Please try again.