https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&feed=atom&action=history
Category:Unikraft Tutorial - Revision history
2024-03-28T10:26:16Z
Revision history for this page on the wiki
MediaWiki 1.31.3
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19586&oldid=prev
Skuenzer: My own library: Include headers globally only when library is enabled
2019-09-11T12:16:26Z
<p>My own library: Include headers globally only when library is enabled</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 12:16, 11 September 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 241:</td>
<td colspan="2" class="diff-lineno">Line 241:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># Extend the global include paths with library's folder</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># Extend the global include paths with library's folder</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>CINCLUDES-<del class="diffchange diffchange-inline">y</del> += -I$(LIBMYLIB_BASE)/include</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>CINCLUDES-<ins class="diffchange diffchange-inline">$(CONFIG_LIBMYLIB)</ins> += -I$(LIBMYLIB_BASE)/include</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
</table>
Skuenzer
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19585&oldid=prev
Skuenzer: Update qemu command line
2019-09-11T12:12:51Z
<p>Update qemu command line</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 12:12, 11 September 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 71:</td>
<td colspan="2" class="diff-lineno">Line 71:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* You can execute the KVM image (<code>helloworld_kvm-x86_64</code>) on the KVM host:</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* You can execute the KVM image (<code>helloworld_kvm-x86_64</code>) on the KVM host:</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>$ qemu-system-x86_64 -<del class="diffchange diffchange-inline">enable-kvm -m 4 -device isa-debug-exit</del> -vga none -device sga -<del class="diffchange diffchange-inline">serial</del> <del class="diffchange diffchange-inline">stdio</del> -kernel build/helloworld_kvm-x86_64</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ qemu-system-x86_64 -<ins class="diffchange diffchange-inline">nographic</ins> -vga none -device sga -<ins class="diffchange diffchange-inline">m</ins> <ins class="diffchange diffchange-inline">4</ins> -kernel build/helloworld_kvm-x86_64</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 305:</td>
<td colspan="2" class="diff-lineno">Line 305:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>$ qemu-system-x86_64 -<del class="diffchange diffchange-inline">m 8 -device isa-debug-exit</del> -vga none -device sga -<del class="diffchange diffchange-inline">serial</del> <del class="diffchange diffchange-inline">stdio</del> -netdev bridge,id=en0,br=<del class="diffchange diffchange-inline">virbr0</del> -device virtio-net-pci,netdev=en0 -kernel build/httpreply_kvm-x86_64</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ qemu-system-x86_64 -<ins class="diffchange diffchange-inline">nographic</ins> -vga none -device sga -<ins class="diffchange diffchange-inline">m</ins> <ins class="diffchange diffchange-inline">8</ins> -netdev bridge,id=en0,br=<ins class="diffchange diffchange-inline">br0</ins> -device virtio-net-pci,netdev=en0 -kernel build/httpreply_kvm-x86_64</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
</table>
Skuenzer
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19252&oldid=prev
Skuenzer at 14:29, 7 May 2019
2019-05-07T14:29:15Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 14:29, 7 May 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 27:</td>
<td colspan="2" class="diff-lineno">Line 27:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>** Unikraft: [http://xenbits.xen.org/gitweb/?p=unikraft/unikraft.git;a=summary upstream repo]</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>** Unikraft: [http://xenbits.xen.org/gitweb/?p=unikraft/unikraft.git;a=summary upstream repo]</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* External libraries into a `libs` subdirectory:</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* External libraries into a `libs` subdirectory:</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>** newlib: [http://xenbits.xen.org/gitweb/?p=unikraft/libs/newlib.git;a=summary upstream repo]<del class="diffchange diffchange-inline">. Please checkout the <code>staging</code> branch: <code>git checkout staging</code></del></div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>** newlib: [http://xenbits.xen.org/gitweb/?p=unikraft/libs/newlib.git;a=summary upstream repo]</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>** lwip: [http://xenbits.xen.org/gitweb/?p=unikraft/libs/lwip.git;a=summary upstream repo]</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>** lwip: [http://xenbits.xen.org/gitweb/?p=unikraft/libs/lwip.git;a=summary upstream repo]</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Applications into a `apps` subdirectory:</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Applications into a `apps` subdirectory:</div></td>
</tr>
</table>
Skuenzer
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19204&oldid=prev
Skuenzer at 13:37, 5 March 2019
2019-03-05T13:37:43Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 13:37, 5 March 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Testing Infrastructure ==</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Testing Infrastructure ==</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>For this tutorial you need a Linux host running Xen and/or KVM in order to run Unikraft images. Please check the manual of your Linux distribution on how to install these environments. This tutorial expects that you have the essential build and debugging tools installed, that you have <code>xl</code> toolstack running when using Xen, and that you have <code>qemu</code> installed when using KVM. Many distributions provide meta-packages for compilers and libraries required to build Linux kernel (Debian/Ubuntu: <code>sudo apt-get install build-essential</code>). Unikraft needs the same set of tools.</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>For this tutorial you need a Linux host running Xen and/or KVM in order to run Unikraft images. Please check the manual of your Linux distribution on how to install these environments. This tutorial expects that you have the essential build and debugging tools installed, that you have <code>xl</code> toolstack<ins class="diffchange diffchange-inline"> installed and</ins> running when using Xen, and that you have <code>qemu</code> installed when using KVM. Many distributions provide meta-packages for compilers and libraries required to build Linux kernel (Debian/Ubuntu: <code>sudo apt-get install build-essential<ins class="diffchange diffchange-inline"> libncurses-dev</ins></code>). Unikraft needs the same set of tools.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Cloning Repositories ==</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Cloning Repositories ==</div></td>
</tr>
</table>
Skuenzer
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19203&oldid=prev
Skuenzer at 13:24, 5 March 2019
2019-03-05T13:24:37Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 13:24, 5 March 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 314:</td>
<td colspan="2" class="diff-lineno">Line 314:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>For debugging, you can also try to enable <code>Debug messages</code> in <code>lwip</code>. With this<del class="diffchange diffchange-inline"> enabled</del> you can now have a deeper look into the network stack.</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>For debugging, you can also try to enable <code>Debug messages</code> in <code>lwip</code>. With this you can now have a deeper look into the network stack.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>If networking is working well, you can use the text-based browser `lynx` to see the web page served on a second terminal (replace the IP with yours):</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>If networking is working well, you can use the text-based browser `lynx`<ins class="diffchange diffchange-inline"> (or any other that you like)</ins> to see the web page served on a second terminal (replace the IP with yours):</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
</table>
Skuenzer
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19202&oldid=prev
Skuenzer: Replace xen-guest and kvm-guest with actual qemu and xl commands
2019-03-05T13:22:10Z
<p>Replace xen-guest and kvm-guest with actual qemu and xl commands</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 13:22, 5 March 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 71:</td>
<td colspan="2" class="diff-lineno">Line 71:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* You can execute the KVM image (<code>helloworld_kvm-x86_64</code>) on the KVM host:</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* You can execute the KVM image (<code>helloworld_kvm-x86_64</code>) on the KVM host:</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>$ kvm-<del class="diffchange diffchange-inline">guest</del> -<del class="diffchange diffchange-inline">k</del> helloworld_kvm-x86_64</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ <ins class="diffchange diffchange-inline">qemu-system-x86_64 -enable-</ins>kvm<ins class="diffchange diffchange-inline"> </ins>-<ins class="diffchange diffchange-inline">m 4 -device isa-debug-exit -vga none -device sga -serial stdio</ins> -<ins class="diffchange diffchange-inline">kernel</ins> <ins class="diffchange diffchange-inline">build/</ins>helloworld_kvm-x86_64</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>With the <code>-D</code> parameter you can have a look to the <code>qemu</code> command line that is used by the script.</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* For Xen you first need to create a VM configuration (save it under <code>helloworld.cfg</code>):</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* The procedure for Xen is similar. Get the Unikernel image on the Xen host and start the virtual machine there:</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>name = 'helloworld'</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>$ xen-guest -k helloworld_xen-x86_64</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>vcpus = '1'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>memory = '4'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>kernel = 'build/helloworld_xen-x86_64'</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Start the virtual machine with:</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ xl create -c helloworld.cfg</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The parameter <code>-D</code> is showing you the generated <code>xl</code> machine configuration by the script.</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Modifying the Application ===</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Modifying the Application ===</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 93:</td>
<td colspan="2" class="diff-lineno">Line 99:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Use <code>xl top</code> in Xen.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Use <code>xl top</code> in Xen.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''Note''': You can terminate the KVM and Linux Unikernel with <code>CTRL</code> + <code>C</code>. <del class="diffchange diffchange-inline">For</del> <del class="diffchange diffchange-inline"><code>xen-guest</code></del> it is <code>CTRL</code> + <code>]</code>.</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''Note''': You can terminate the KVM and Linux Unikernel with <code>CTRL</code> + <code>C</code>. <ins class="diffchange diffchange-inline">On</ins> <ins class="diffchange diffchange-inline">Xen</ins> it is <code>CTRL</code> + <code>]</code>.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== External Libraries ==</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== External Libraries ==</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 148:</td>
<td colspan="2" class="diff-lineno">Line 154:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Type <code>make clean</code> and then <code>make</code>: we want to make sure that every object file is rebuilt with debugging information.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Type <code>make clean</code> and then <code>make</code>: we want to make sure that every object file is rebuilt with debugging information.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Start the guest on a Xen host in paused state<del class="diffchange diffchange-inline"> and enable the GDB server option</del>:</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Start the guest on a Xen host in paused state:</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ xl create -c -p helloworld.cfg</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>$ xen-guest -k build/helloworld_xen-x86_64 -g 9999 -P</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>On a second terminal, you first figure out the ID of your just created guest:</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>On a second terminal, attach <code>gdb</code> to the virtual machine. You can set a breakpoint to <code>main()</code> and start the VM with <code>continue</code>:</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ xl list</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Name ID Mem VCPUs State Time(s)</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Domain-0 0 6144 1 r----- 257.5</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>helloworld 17 4 1 --p--- 0.0</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>you start executing the Xen debugger backend and attach it to the VM (replace the ID 17 with yours):</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ gdbsx -a 17 64 9999</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Listening on port 9999</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>On a third terminal session, attach <code>gdb</code> to the virtual machine. You can set a breakpoint to <code>main()</code> and start the VM with <code>continue</code>:</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>$ gdb --eval-command="target remote :9999" build/helloworld_xen-x86_64</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ gdb --eval-command="target remote :9999" build/helloworld_xen-x86_64<ins class="diffchange diffchange-inline">.dbg</ins></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>GNU gdb (Debian 7.12-6) 7.12.0.20161007-git</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>GNU gdb (Debian 7.12-6) 7.12.0.20161007-git</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Copyright (C) 2016 Free Software Foundation, Inc.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Copyright (C) 2016 Free Software Foundation, Inc.</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 283:</td>
<td colspan="2" class="diff-lineno">Line 302:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For now, we support virtio for networking only (but more functionality is coming). You can enable the driver by going to the KVM platform configuration and selecting <code>Virtio PCI device support</code> and <code>Virtio Net device</code>.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For now, we support virtio for networking only (but more functionality is coming). You can enable the driver by going to the KVM platform configuration and selecting <code>Virtio PCI device support</code> and <code>Virtio Net device</code>.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The image can be started on the KVM host. <del class="diffchange diffchange-inline">Remember</del> <del class="diffchange diffchange-inline">to</del> <del class="diffchange diffchange-inline">add</del> <del class="diffchange diffchange-inline">a</del> <del class="diffchange diffchange-inline">virtual</del> <del class="diffchange diffchange-inline">network</del> <del class="diffchange diffchange-inline">device</del> <del class="diffchange diffchange-inline">attached</del> <del class="diffchange diffchange-inline">to</del> <del class="diffchange diffchange-inline">the</del> <del class="diffchange diffchange-inline">bridge</del> <code><del class="diffchange diffchange-inline">virbr0</del></code>:</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The image can be started on the KVM host. <ins class="diffchange diffchange-inline">Replace</ins> <ins class="diffchange diffchange-inline"><code>virbr0</code></ins> <ins class="diffchange diffchange-inline">with</ins> <ins class="diffchange diffchange-inline">the</ins> <ins class="diffchange diffchange-inline">name</ins> <ins class="diffchange diffchange-inline">of</ins> <ins class="diffchange diffchange-inline">your</ins> <ins class="diffchange diffchange-inline">local</ins> <ins class="diffchange diffchange-inline">bridge</ins> <ins class="diffchange diffchange-inline">on</ins> <ins class="diffchange diffchange-inline">your system and make sure you have a DHCP server listening there (e.g.,</ins> <code><ins class="diffchange diffchange-inline">dnsmasq</ins></code><ins class="diffchange diffchange-inline">)</ins>:</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty"> </td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>$ qemu-system-x86_64 -m 8 -device isa-debug-exit -vga none -device sga -serial stdio -netdev bridge,id=en0,br=virbr0 -device virtio-net-pci,netdev=en0 -kernel build/httpreply_kvm-x86_64</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>$ kvm-guest -k build/httpreply_kvm-x86_64 -b virbr0</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This Unikernel is requesting an IPv4 address via DHCP. <del class="diffchange diffchange-inline">If</del> you <del class="diffchange diffchange-inline">do</del> <del class="diffchange diffchange-inline">not</del> <del class="diffchange diffchange-inline">have</del> <del class="diffchange diffchange-inline">one listening on</del> <code><del class="diffchange diffchange-inline">virbr0</del></code>, you <del class="diffchange diffchange-inline">could</del> <del class="diffchange diffchange-inline">start</del> a <del class="diffchange diffchange-inline"><code>dnsmasq</code></del> <del class="diffchange diffchange-inline">server</del> <del class="diffchange diffchange-inline">form</del> the <del class="diffchange diffchange-inline">command</del> <del class="diffchange diffchange-inline">line.</del></div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This Unikernel is requesting an IPv4 address via DHCP. <ins class="diffchange diffchange-inline">In case</ins> you <ins class="diffchange diffchange-inline">enabled</ins> <ins class="diffchange diffchange-inline"><code>ICMP</code></ins> <ins class="diffchange diffchange-inline">in</ins> <ins class="diffchange diffchange-inline">the</ins> <code><ins class="diffchange diffchange-inline">lwip</ins></code><ins class="diffchange diffchange-inline"> configuration</ins>, you <ins class="diffchange diffchange-inline">should</ins> <ins class="diffchange diffchange-inline">also be able to ping the host from</ins> a <ins class="diffchange diffchange-inline">second</ins> <ins class="diffchange diffchange-inline">terminal</ins> <ins class="diffchange diffchange-inline">(replace</ins> the <ins class="diffchange diffchange-inline">IP with</ins> <ins class="diffchange diffchange-inline">yours):</ins></div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In case you enabled <code>ICMP</code> in the <code>lwip</code> configuration, you should also be able to ping the host from a second terminal:</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 298:</td>
<td colspan="2" class="diff-lineno">Line 316:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For debugging, you can also try to enable <code>Debug messages</code> in <code>lwip</code>. With this enabled you can now have a deeper look into the network stack.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For debugging, you can also try to enable <code>Debug messages</code> in <code>lwip</code>. With this enabled you can now have a deeper look into the network stack.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>If networking is working well, you can use the text-based browser `lynx` to see the web page served on a second terminal:</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>If networking is working well, you can use the text-based browser `lynx` to see the web page served on a second terminal<ins class="diffchange diffchange-inline"> (replace the IP with yours)</ins>:</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td>
</tr>
</table>
Skuenzer
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19199&oldid=prev
Skuenzer: /* Code Your Own Library */
2019-02-26T15:03:09Z
<p><span dir="auto"><span class="autocomment">Code Your Own Library</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 15:03, 26 February 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 225:</td>
<td colspan="2" class="diff-lineno">Line 225:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>And finally the library code <del class="diffchange diffchange-inline">`</del>mylib.c<del class="diffchange diffchange-inline">`</del>:</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>And finally the library code <ins class="diffchange diffchange-inline"><code></ins>mylib.c<ins class="diffchange diffchange-inline"></code></ins>:</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><<del class="diffchange diffchange-inline">code</del>></div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><<ins class="diffchange diffchange-inline">pre</ins>></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#include <stdio.h></div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#include <stdio.h></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 234:</td>
<td colspan="2" class="diff-lineno">Line 234:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> printf("Hello from my awesome lib!\n");</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> printf("Hello from my awesome lib!\n");</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div></<del class="diffchange diffchange-inline">code</del>></div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></<ins class="diffchange diffchange-inline">pre</ins>></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><code>include/mylib/mylib.h</code>:</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><code>include/mylib/mylib.h</code>:</div></td>
</tr>
</table>
Skuenzer
https://wiki.xenproject.org/index.php?title=Category:Unikraft_Tutorial&diff=19198&oldid=prev
Skuenzer: Port from sysml github (ucc-unikraft)
2019-02-26T15:00:08Z
<p>Port from sysml github (ucc-unikraft)</p>
<p><b>New page</b></p><div>= Unikraft Tutorial =<br />
<br />
== Testing Infrastructure ==<br />
<br />
For this tutorial you need a Linux host running Xen and/or KVM in order to run Unikraft images. Please check the manual of your Linux distribution on how to install these environments. This tutorial expects that you have the essential build and debugging tools installed, that you have <code>xl</code> toolstack running when using Xen, and that you have <code>qemu</code> installed when using KVM. Many distributions provide meta-packages for compilers and libraries required to build Linux kernel (Debian/Ubuntu: <code>sudo apt-get install build-essential</code>). Unikraft needs the same set of tools.<br />
<br />
== Cloning Repositories ==<br />
<br />
You can easily build Unikraft Unikernels on your Linux host. If you have all tools and libraries installed to compile a Linux kernel you are ready to do this with Unikraft too. Alternatively, you can directly compile Unikraft on the testing infrastructure that you got access too. It has compiler, tools, and necessary libraries pre-installed.<br />
<br />
A Unikraft build consists mostly of a combination of multiple repositories. We differentiate them into: (1) Unikraft, (2) external libraries, (3) application.<br />
The build system assumes these to be structured as follows:<br />
<br />
<pre><br />
my-workspace/<br />
├── apps/<br />
│ └── helloworld/<br />
│ └── httpreply/<br />
├── libs/<br />
│ ├── lwip/<br />
│ └── newlib/<br />
└── unikraft/<br />
</pre><br />
<br />
Clone the following repositories with Git (<code>git clone [URL] [DESTINATION PATH]</code>):<br />
* Unikraft base repository directly under your workspace root: <br />
** Unikraft: [http://xenbits.xen.org/gitweb/?p=unikraft/unikraft.git;a=summary upstream repo]<br />
* External libraries into a `libs` subdirectory:<br />
** newlib: [http://xenbits.xen.org/gitweb/?p=unikraft/libs/newlib.git;a=summary upstream repo]. Please checkout the <code>staging</code> branch: <code>git checkout staging</code><br />
** lwip: [http://xenbits.xen.org/gitweb/?p=unikraft/libs/lwip.git;a=summary upstream repo]<br />
* Applications into a `apps` subdirectory:<br />
** helloworld: [http://xenbits.xen.org/gitweb/?p=unikraft/apps/helloworld.git;a=summary upstream repo]<br />
** httpreply: [http://xenbits.xen.org/gitweb/?p=unikraft/apps/httpreply.git;a=summary upstream repo]<br />
<br />
Make sure that the directory structure under your workspace is exactly the same as shown in the overview ahead (e.g., call the folder of the cloned Unikraft repository <code>unikraft</code>)<br />
<br />
== Your First Unikernel ==<br />
<br />
=== Configuring ===<br />
After you cloned the repos, go to the <code>helloworld</code> application and run <code>make menuconfig</code> to configure the build. Unikraft uses the same configuration system as the Linux kernel (Kconfig). We will build Unikraft images for Xen, KVM, and Linux, so the first step is to go to the <code>Platform Configuration</code> option and make the following changes:<br />
* select <code>Xen guest image</code><br />
* select <code>KVM guest</code><br />
* select <code>Linux user space</code><br />
Under <code>Library configuration</code> we also need to choose a scheduler: select <code>ukschedcoop</code>.<br />
<br />
=== Building ===<br />
Afterwards, save your configuration and build the image by typing `make`. The build system will create three binaries, one for each platform:<br />
<pre><br />
$ ls -sh build/<br />
[...]<br />
88K helloworld_kvm-x86_64<br />
40K helloworld_linuxu-x86_64<br />
72K helloworld_xen-x86_64<br />
[...]<br />
</pre><br />
<br />
=== Running ===<br />
<br />
Let's execute our Unikernel.<br />
* The easiest to run is the one that we built as a Linux user space application. It should execute on any Linux environment:<br />
<pre><br />
$ build/helloworld_linuxu-x86_64<br />
Welcome to _ __ _____<br />
__ _____ (_) /__ _______ _/ _/ /_<br />
/ // / _ \/ / '_// __/ _ `/ _/ __/<br />
\_,_/_//_/_/_/\_\/_/ \_,_/_/ \__/<br />
Titan 0.2~10ce3f2<br />
Hello world!<br />
</pre><br />
<br />
* You can execute the KVM image (<code>helloworld_kvm-x86_64</code>) on the KVM host:<br />
<pre><br />
$ kvm-guest -k helloworld_kvm-x86_64<br />
</pre><br />
With the <code>-D</code> parameter you can have a look to the <code>qemu</code> command line that is used by the script.<br />
<br />
* The procedure for Xen is similar. Get the Unikernel image on the Xen host and start the virtual machine there:<br />
<pre><br />
$ xen-guest -k helloworld_xen-x86_64<br />
</pre><br />
The parameter <code>-D</code> is showing you the generated <code>xl</code> machine configuration by the script.<br />
<br />
=== Modifying the Application ===<br />
<br />
After <code>Hello world!</code> is printed, our Unikernel shuts down right away. We do not have a chance to see that a VM was actually created, so let's modify the source code. Open <code>main.c</code> in your favorite editor (<code>nano</code>, <code>vim</code>, <code>emacs</code>) and add the following busy loop accordingly within the <code>main</code> function:<br />
<br />
<code><br />
for (;;);<br />
</code><br />
<br />
Rebuild the images with <code>make</code> and execute them. The shell prompt should not return. With a second shell your can check that the Unikernel is still executing:<br />
* Use <code>top</code> or <code>htop</code> for Linux and KVM.<br />
* Use <code>xl top</code> in Xen.<br />
<br />
'''Note''': You can terminate the KVM and Linux Unikernel with <code>CTRL</code> + <code>C</code>. For <code>xen-guest</code> it is <code>CTRL</code> + <code>]</code>.<br />
<br />
== External Libraries ==<br />
<br />
The <code>helloworld</code> application uses a very minimalistic <code>libc</code> implementation called <code>nolibc</code>. It is small but also quite limited in terms of functionality. <code>nolibc</code> is part of the Unikraft base repository and because of this it is called an ''internal'' library. They are located within the <code>lib</code> directory of Unikraft.<br />
<br />
In order to enhance the functionality provided by Unikraft, ''external'' libraries can be added to the build. In the following we want to swap <code>nolibc</code> with [http://www.sourceware.org/newlib/ newlib], a standard libc implementation that you can find in various Linux distributions and embedded environments.<br />
<br />
We need to add newlib to the library includes. Edit the <code>Makefile</code> of the <code>helloworld</code> application. Please type <code>make properclean</code> before; this will delete the build directory (but not your configuration) and will force a full rebuild later.<br />
<br />
<pre><br />
diff --git a/Makefile b/Makefile<br />
--- a/Makefile<br />
+++ b/Makefile<br />
@@ -1,6 +1,6 @@<br />
UK_ROOT ?= $(PWD)/../../unikraft<br />
UK_LIBS ?= $(PWD)/../../libs<br />
-LIBS :=<br />
+LIBS := $(UK_LIBS)/newlib<br />
<br />
all:<br />
@make -C $(UK_ROOT) A=$(PWD) L=$(LIBS)<br />
</pre><br />
<br />
Run <code>make menuconfig</code>, <code>newlib</code> should now appear in the <code>Library Configuration</code> menu. Select it, and select also <code>vfscore</code> (unfortunately this dependency is currently not automatically selected in the upstream repository). Afterwards type <code>make</code>. Unikraft's build system will download newlib's sources and build it together with all the other Unikraft libraries and application. Our <code>newlib</code> repository consists only of glue code that is needed to port <code>newlib</code> to Unikraft.<br />
<br />
You will notice that the built Unikernels are bigger than before. Try to run them again.<br />
<br />
== Debugging ==<br />
<br />
Debugging a Unikernel is similar to debugging an application. In the following we will use print-based debugging and [https://en.wikipedia.org/wiki/GNU_Debugger GDB].<br />
<br />
=== Print-based Debugging ===<br />
<br />
Unikraft provides support for debug printing with the ''internal'' <code>libukdebug</code> library. Code needs to be instrumented but the advantage is that the library automatically removes all print calls as soon as you disable debug printing.<br />
<br />
We enable them by going to <code>Library Configuration</code> and <code>ukdebug</code>. Here we can change the logging level but also enable or disable various types of additional debugging features (e.g., assertions).<br />
<br />
* Change <code>Kernel message level</code> to have the <code>Show all types of messages</code> value<br />
* Enable <code>Print bottom address of stack in messages</code><br />
* Enable <code>Enable debug messages globally</code><br />
<br />
As a side note: ''When the last option is disabled, compilation units can enable debug messages individually. This is done by defining <code>UK_DEBUG</code> as a preprocessor macro to the compiler command line. This allows selective debug investigation with the same instrumented code (<code>uk_pr_debug()</code>). You can see an example in lwip's <code>Makefile.uk</code>.''<br />
<br />
=== GDB ===<br />
<br />
With support from the virtualization platform and its toolstack (e.g., <code>qemu</code> on KVM, <code>xl</code> on Xen), a <code>gdb</code> process can be attached to the instances. In the following we will try it out with Xen.<br />
<br />
To start with, we must ensure that debug symbols are generated when building Unikraft. For this you have to run `make menuconfig` again and go to the `Build Options` menu. The following needs to be changed:<br />
* <code>Optimization level</code>: No optimizations<br />
* <code>Debugging information</code>: <br />
* <code>Debug information level</code>: <code>Level 3</code><br />
* Unselect <code>Strip final image</code><br />
Type <code>make clean</code> and then <code>make</code>: we want to make sure that every object file is rebuilt with debugging information.<br />
<br />
Start the guest on a Xen host in paused state and enable the GDB server option:<br />
<br />
<pre><br />
$ xen-guest -k build/helloworld_xen-x86_64 -g 9999 -P<br />
</pre><br />
<br />
On a second terminal, attach <code>gdb</code> to the virtual machine. You can set a breakpoint to <code>main()</code> and start the VM with <code>continue</code>:<br />
<br />
<pre><br />
$ gdb --eval-command="target remote :9999" build/helloworld_xen-x86_64<br />
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git<br />
Copyright (C) 2016 Free Software Foundation, Inc.<br />
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html><br />
This is free software: you are free to change and redistribute it.<br />
There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br />
and "show warranty" for details.<br />
This GDB was configured as "x86_64-linux-gnu".<br />
Type "show configuration" for configuration details.<br />
For bug reporting instructions, please see:<br />
<http://www.gnu.org/software/gdb/bugs/>.<br />
Find the GDB manual and other documentation resources online at:<br />
<http://www.gnu.org/software/gdb/documentation/>.<br />
For help, type "help".<br />
Type "apropos word" to search for commands related to "word"...<br />
Reading symbols from helloworld_xen-x86_64...done.<br />
Remote debugging using :9999<br />
0x0000000000000000 in _text ()<br />
(gdb) br main<br />
Breakpoint 1 at 0x8a7d: main. (2 locations)<br />
(gdb) c<br />
Continuing.<br />
<br />
[...]<br />
</pre><br />
<br />
== Code Your Own Library ==<br />
Let's add some functionality to our unikernel. Create a directory <code>libs/mylib</code>, this will be the root folder of your library.<br />
<br />
As mentioned earlier, Unikraft uses Linux's kconfig system imported. In order to make your library selectable in the "menuconfig", create the file <code>Config.uk</code> with the following content:<br />
<br />
<pre><br />
config LIBMYLIB<br />
bool "mylib: My awesome lib"<br />
default n<br />
</pre><br />
<br />
To test if it worked, we need to tell unikraft's build system to pick this library. Go back to your <code>helloworld</code> application, and edit it its <code>Makefile</code>. Earlier we added newlib to the <code>LIBS</code> variable, let's now add the new library:<br />
<br />
<pre><br />
LIBS := $(UK_LIBS)/newlib:$(UK_LIBS)/mylib<br />
</pre><br />
<br />
Now if you run <code>make menuconfig</code>, you should see your library under the "Library Configuration" sub-menu:<br />
<br />
<pre><br />
[ ] mylib: My awesome lib<br />
</pre><br />
<br />
Select it, exit the configuration menu, and save the changes. If you run <code>make</code> right now, the build will produce an error about a missing <code>Makefile.uk</code>:<br />
<br />
<pre><br />
make[1]: *** No rule to make target '/root/demo/libs/mylib/Makefile.uk'. Stop.<br />
</pre><br />
<br />
Go back to your library directory and create one with the following content:<br />
<br />
<pre><br />
# Register your lib to Unikraft's build system<br />
$(eval $(call addlib_s,libmylib,$(CONFIG_LIBMYLIB)))<br />
<br />
# Add library source code to compilation<br />
LIBMYLIB_SRCS-y += $(LIBMYLIB_BASE)/mylib.c<br />
<br />
# Extend the global include paths with library's folder<br />
CINCLUDES-y += -I$(LIBMYLIB_BASE)/include<br />
</pre><br />
<br />
And finally the library code `mylib.c`:<br />
<br />
<code><br />
#include <stdio.h><br />
<br />
void libmylib_api_func(void)<br />
{<br />
printf("Hello from my awesome lib!\n");<br />
}<br />
</code><br />
<br />
<code>include/mylib/mylib.h</code>:<br />
<br />
<pre><br />
#ifndef __LIB_MYLIB_H__<br />
#define __LIB_MYLIB_H__<br />
<br />
void libmylib_api_func(void);<br />
<br />
#endif /* __LIB_MYLIB_H__ */<br />
</pre><br />
<br />
Now in your helloworld's <code>main.c</code>, add <code>#include <mylib/mylib.h></code> and call <code>libmylib_api_func()</code>.<br />
<br />
=== exportsyms.uk ===<br />
<br />
Even though your library is working now, you might have noticed a warning message:<br />
<br />
<pre><br />
Warning: Definition of exported symbols for libmylib missing: /root/demo/libs/mylib/exportsyms.uk<br />
</pre><br />
<br />
This is because <code>Unikraft</code> applies scoping to every library: only the symbols listed in <code>exportsyms.uk</code> will be visible outside of the library. If the file is missing (our current case), all the symbols are exported, but the warning is produced. <br />
<br />
Let's create this file in the root of `mylib` with only one line:<br />
<br />
<pre><br />
libmylib_api_func<br />
</pre><br />
<br />
If you compile the <code>helloworld</code> application again, you will notice that the warning is gone. To get an impression of how scoping works, edit the <code>exportsyms.uk</code> file again and add an underscore (or any other character which is valid to use in the symbol name) to your exported symbol:<br />
<br />
<pre><br />
libmylib_api_func_<br />
</pre><br />
<br />
Since <code>libmylib_api_func</code> is not exported anymore, you should now get a compilation error:<br />
<br />
<pre><br />
sglist.c:(.text.startup+0x60): undefined reference to `libmylib_api_func'<br />
</pre><br />
<br />
== Socket Example ==<br />
<br />
As a last task, we are going to build a small webserver that replies with a single page. The server uses <code>lwip</code> for creating a socket and to accept incoming connections. Go to the <code>httpreply</code> application directory. Have a look at <code>main.c</code>: it is a really short program and looks similar to what you would write as a user-space Linux program. Its dependencies are defined within <code>Config.uk</code>. Having this, there is actually not much left to configure. Mandatory options are locked in <code>make menuconfig</code>. All we need to do is to select our target platforms, select network drivers, save the config, and type <code>make</code>.<br />
<br />
For now, we support virtio for networking only (but more functionality is coming). You can enable the driver by going to the KVM platform configuration and selecting <code>Virtio PCI device support</code> and <code>Virtio Net device</code>.<br />
<br />
The image can be started on the KVM host. Remember to add a virtual network device attached to the bridge <code>virbr0</code>:<br />
<br />
<pre><br />
$ kvm-guest -k build/httpreply_kvm-x86_64 -b virbr0<br />
</pre><br />
<br />
This Unikernel is requesting an IPv4 address via DHCP. If you do not have one listening on <code>virbr0</code>, you could start a <code>dnsmasq</code> server form the command line.<br />
In case you enabled <code>ICMP</code> in the <code>lwip</code> configuration, you should also be able to ping the host from a second terminal:<br />
<br />
<pre><br />
$ ping 192.168.1.100<br />
</pre><br />
<br />
For debugging, you can also try to enable <code>Debug messages</code> in <code>lwip</code>. With this enabled you can now have a deeper look into the network stack.<br />
<br />
If networking is working well, you can use the text-based browser `lynx` to see the web page served on a second terminal:<br />
<br />
<pre><br />
$ lynx 192.168.1.100:8123<br />
</pre></div>
Skuenzer