Skip to content

Commit

Permalink
sync slides
Browse files Browse the repository at this point in the history
  • Loading branch information
avsm committed Sep 21, 2011
1 parent da8169b commit f0c1ef3
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 29 deletions.
5 changes: 1 addition & 4 deletions examples/net/http/server.ml
Expand Up @@ -12,10 +12,7 @@ let ip =
let main () =
Log.info "Server" "listening to HTTP on port %d" port;
Log.info "Server" "finding the static kv_ro block device";
lwt static = OS.Devices.find_kv_ro "static" >>=
function
| None -> Printf.printf "fatal error, static kv_ro not found\n%!"; exit 1
| Some x -> return x in
lwt static = OS.Devices.with_kv_ro "static" return in
Log.info "Server" "found static kv_ro";
let callback = Dispatch.t static in
let spec = {
Expand Down
9 changes: 0 additions & 9 deletions examples/sleep/sleep.ml

This file was deleted.

3 changes: 0 additions & 3 deletions slides/cloud.ml
Expand Up @@ -20,9 +20,6 @@ let slides = [
content= <:html<
<h3>How Kernels Boot on Amazon</h3>
<ul>
<li>PV, ignore HVM for now. </li>
<li>Explain pvgrub</li>
<li>some segway into XCP here?</li>
</ul>
>>
};
Expand Down
4 changes: 2 additions & 2 deletions slides/lwt_exercises.ml
Expand Up @@ -24,7 +24,7 @@ let slides = [
and the other "Tails".</p>
<p>After both have finished, print "Finished" and exits.</p>
<pre class="noprettyprint">
$str:dl$ cd mirage-tutorial/examples/01-lwt
$str:dl$ cd mirage-tutorial/examples/lwt
$str:dl$ vim mysleep.ml
$str:dl$ make mysleep
# answer is in sleep.ml
Expand All @@ -43,7 +43,7 @@ $str:dl$ make mysleep
<p>Write an echo server that reads from a dummy input generator and
writes each input read to the console. The server should stop listening after 10 inputs are received.</p>
<pre class="noprettyprint">
$str:dl$ cd mirage-tutorial/examples/01-lwt
$str:dl$ cd mirage-tutorial/examples/lwt
$str:dl$ vim myecho1.ml
$str:dl$ make myecho1
# answer is in echo1.ml
Expand Down
4 changes: 2 additions & 2 deletions slides/lwt_tutorial.ml
Expand Up @@ -37,7 +37,7 @@ let slides = [
<li><tt>Lwt</tt> wraps event callbacks to maintain the illusion of straight-line code.</li>
</ul>
<p>Let's look at some examples.
They are all in<br /> <a href="https://github.com/avsm/mirage-tutorial/tree/master/">mirage-tutorial/examples/01-lwt</a>, and you build them by:</p>
They are all in<br /> <a href="https://github.com/avsm/mirage-tutorial/tree/master/">mirage-tutorial/examples/lwt</a>, and you build them by:</p>
<section><pre class="noprettyprint">
$str:dl$ mir-build unix-socket/sleep.bin
$str:dl$ ./_build/unix-socket/sleep.bin</pre></section>
Expand Down Expand Up @@ -90,7 +90,7 @@ val join : unit Lwt.t list -> unit Lwt.t
styles=[];
content= <:html<
<h3>Lwt syntax extension</h3>
<p><tt>01-lwt/sleep.ml</tt> (<tt>make sleep</tt>)</p>
<p><tt>lwt/sleep.ml</tt> (<tt>make sleep</tt>)</p>
<pre>
lwt () = OS.Time.sleep 1.0 in
lwt () = OS.Time.sleep 2.0 in
Expand Down
4 changes: 2 additions & 2 deletions slides/miragep4.ml
Expand Up @@ -39,7 +39,7 @@ let slides = [
{
styles =[];
content = <:html<
<h3>Web Syntax Extension</h3>
<h3>Web Syntax extensions</h3>
<ul>
<li>Web expressions are written natively in Mirage (where they are called quotations):
<pre>let x = $html$&#60;h1>Hello&#60;/h1>World!$cl$</pre></li>
Expand All @@ -57,7 +57,7 @@ let x = List.flatten [
{
styles = [];
content = <:html<
<h3>Web Syntax extensions</h3>
<h3>Web Syntax extensions (ii)</h3>
<ul>
<li>One can use template-like (anti-quotations) to parameterize quotations:
<pre>let x title = $html$&#60;h1>$dl$title$dl$&#60;/h1>content$cl$</pre></li>
Expand Down
20 changes: 18 additions & 2 deletions slides/website.ml
Expand Up @@ -18,8 +18,24 @@ let slides = [
{
styles=[];
content= <:html<
<h3>Provide a skeleton repository in mirage-tutorial that can be filled in</h3>
<p>Login details for laptops they can use with EC2 on them</p>
<h3>Skeleton HTTP Server</h3>
<p>Mirage has a rather hacked up HTTP implementation (but it does work!) in $github "lib/http" "Http"$.</p>
<p>Take a shot at filling in your own website.</p>
<pre class="noprettyprint">
$str:dl$ cd mirage-tutorial/net/http
$str:dl$ vi server.ml
$str:dl$ vi dispatch.ml
$str:dl$ make
</pre>
<table>
<tr><th>Target</th><th>Backend</th><th>Storage</th><th>Network</th> </tr>
<tr><td>run-socket_crunch</td><td>UNIX</td><td>Builtin</td><td>Sockets</td></tr>
<tr><td>run-socket_fs</td><td>UNIX</td><td>UNIX filesystem</td><td>Sockets</td></tr>
<tr><td>run-direct_crunch</td><td>UNIX</td><td>Builtin</td><td>Tuntap+OCaml</td></tr>
<tr><td>run-direct_fs</td><td>UNIX</td><td>Disk image+OCaml</td><td>Tuntap+OCaml</td></tr>
<tr><td>run-xen_crunch</td><td>Xen</td><td>Builtin</td><td>Xennet+OCaml</td></tr>
<tr><td>run-xen_fs</td><td>Xen</td><td>Xenblock+OCaml</td><td>Xennet+OCaml</td></tr>
</table>
>>
};
]
Expand Down
26 changes: 21 additions & 5 deletions slides/whatis.ml
Expand Up @@ -75,17 +75,33 @@ modules 4;
<p><tt>mir-build</tt> is a wrapper over <tt>ocamlbuild</tt>.<br />
Output files are in <tt>_build/</tt> and source is never modified.</p>
<ul>
<li><tt>mir-build -clean</tt> will remove all built files</li>
<li><tt>mir-build -j 5</tt> runs a parallel build.</li>
<li><b><tt>mir-build -clean</tt></b> will remove all built files</li>
<li><b><tt>mir-build -j 5</tt></b> runs a parallel build.</li>
</ul>
<ul>
<li><b><tt>mir-run -b <i>backend</i> <i>binary</i></tt></b> will execute it (or you can call it directly too).</li>
<li>We will cover the advanced options later!</li>
</ul>
<p>All of this build-time synthesis is wrapped by the powerful <tt>ocamlbuild</tt>, which supports dynamic dependencies.</p>
>>
};
{ styles=[];
content= <:html<
<h3>Try it Out</h3>
<p>Mirage also has extra rules. Prepend the backend name to your target:</p>
<section><pre class="noprettyprint">
$str:dl$ mir-build xen/hello.xen
$str:dl$ mir-build node/hello.js
$str:dl$ cd mirage-tutorial/examples/hello
$str:dl$ mir-build unix-direct/hello.bin
$str:dl$ mir-build unix-socket/hello.bin
$str:dl$ mir-build xen/hello.xen # need Linux x86_64
$str:dl$ mir-build node/hello.js # need js_of_ocaml
$str:dl$ mir-run -b unix-socket _build/unix-socket/hello.bin
$str:dl$ mir-run -b unix-direct _build/unix-direct/hello.bin
$str:dl$ mir-run -b node _build/node/hello.js
$str:dl$ mir-run -b xen _build/xen/hello.xen
</pre></section>
<p>All of this build-time synthesis is wrapped by the powerful <tt>ocamlbuild</tt>, which supports dynamic dependencies.</p>
<p>Got a working system? Lets make sure we do before moving on.</p>
>>
};

Expand Down

0 comments on commit f0c1ef3

Please sign in to comment.