<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Introduction on LionsOS 0.3.0</title><link>https://lionsos.org/</link><description>Recent content in Introduction on LionsOS 0.3.0</description><generator>Hugo</generator><language>en-au</language><lastBuildDate>Mon, 19 Feb 2024 06:34:24 +1100</lastBuildDate><atom:link href="https://lionsos.org/index.xml" rel="self" type="application/rss+xml"/><item><title>Driver Virtual Machines</title><link>https://lionsos.org/docs/tutorials/drivervm/driver_vm/</link><pubDate>Mon, 19 Feb 2024 06:34:24 +1100</pubDate><guid>https://lionsos.org/docs/tutorials/drivervm/driver_vm/</guid><description>&lt;h1 id="background-reading">
 Background Reading
 &lt;a class="anchor" href="#background-reading">#&lt;/a>
&lt;/h1>
&lt;p>See the manual on &lt;a href="https://github.com/au-ts/libvmm/blob/main/docs/MANUAL.md">Github&lt;/a>&lt;/p>
&lt;h1 id="setting-up-your-environment">
 Setting up your environment
 &lt;a class="anchor" href="#setting-up-your-environment">#&lt;/a>
&lt;/h1>
&lt;p>Follow the standard instructions at &lt;a href="../GettingStarted">Getting and Building
LionsOS&lt;/a>&lt;/p>
&lt;h1 id="first-steps-odroid-c4">
 First steps: Odroid C4
 &lt;a class="anchor" href="#first-steps-odroid-c4">#&lt;/a>
&lt;/h1>
&lt;p>There are several templates for different platforms in the &lt;a href="https://github.com/au-ts/libvmm/tree/main/examples">LionsOS
VMM Examples&lt;/a>
directory. You can take a look at them; but we&amp;rsquo;re going to start
more-or-less from scratch for this.&lt;/p>
&lt;p>For a driver VM we want to pass through everythng, and if possible use
an upstream kernel. First step therefore is to install your linux
system of choice on the hardware. We&amp;rsquo;re using the Odroid C4; examples
assume the Ubuntu &lt;em>Jammy&lt;/em> distribution from
&lt;a href="https://www.armbian.com/odroid-c4/">Armbian&lt;/a>. Get that working
first, on the eMMC, with a serial console.&lt;/p></description></item><item><title>Hardware setup</title><link>https://lionsos.org/docs/examples/kitty/hardware/</link><pubDate>Tue, 12 Dec 2023 21:00:47 +1100</pubDate><guid>https://lionsos.org/docs/examples/kitty/hardware/</guid><description>&lt;h1 id="setting-up-your-odroid-c4-hardware">
 Setting up your Odroid-C4 hardware
 &lt;a class="anchor" href="#setting-up-your-odroid-c4-hardware">#&lt;/a>
&lt;/h1>
&lt;p>The example system targets the HardKernel Odroid-C4 platform as it is a fairly inexpensive, accessible, and reliable ARM single-board-computer.&lt;/p>
&lt;p>The Odroid-C4 is available for purchase &lt;a href="https://www.hardkernel.com/shop/odroid-c4/">directly from HardKernel&lt;/a>.&lt;/p>
&lt;p>Official documentation for the Odroid-C4 is available &lt;a href="https://wiki.odroid.com/odroid-c4/odroid-c4">here&lt;/a>.&lt;/p>
&lt;p>&lt;img src="https://lionsos.org/all_hardware.jpeg" alt="TODO" />&lt;/p>
&lt;h2 id="what-you-will-need">
 What you will need
 &lt;a class="anchor" href="#what-you-will-need">#&lt;/a>
&lt;/h2>
&lt;h3 id="required">
 Required
 &lt;a class="anchor" href="#required">#&lt;/a>
&lt;/h3>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Hardware&lt;/th>
 &lt;th>Link&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>HardKernel Odroid-C4 SBC&lt;/td>
 &lt;td>&lt;a href="https://www.hardkernel.com/shop/odroid-c4/">https://www.hardkernel.com/shop/odroid-c4/&lt;/a>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Power Supply&lt;/td>
 &lt;td>12V 2A&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>3.3V TTL-level UART to USB converter&lt;/td>
 &lt;td>&lt;a href="https://www.hardkernel.com/shop/usb-uart-2-module-kit-copy/">https://www.hardkernel.com/shop/usb-uart-2-module-kit-copy/&lt;/a>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>SD card or eMMC&lt;/td>
 &lt;td>&lt;a href="https://www.hardkernel.com/shop/16gb-emmc-module-c4-linux/">https://www.hardkernel.com/shop/16gb-emmc-module-c4-linux/&lt;/a>&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h3 id="optional">
 Optional
 &lt;a class="anchor" href="#optional">#&lt;/a>
&lt;/h3>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Hardware&lt;/th>
 &lt;th>Link&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>PN532 NFC card reader&lt;/td>
 &lt;td>&lt;a href="https://www.fruugoaustralia.com/pn532-nfc-rfid-v3-module-near-field-communication-support-and-android-phone-communication/p-228968185-488544821">https://www.fruugoaustralia.com/pn532-nfc-rfid-v3-module-near-field-communication-support-and-android-phone-communication/p-228968185-488544821&lt;/a>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>VU7C touchscreen display&lt;/td>
 &lt;td>&lt;a href="https://www.hardkernel.com/shop/odroid-vu7c-7inch-1024x600-hdmi-display-with-multi-touch/">https://www.hardkernel.com/shop/odroid-vu7c-7inch-1024x600-hdmi-display-with-multi-touch/&lt;/a>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Ethernet cable&lt;/td>
 &lt;td>&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="connecting-everything-together">
 Connecting everything together
 &lt;a class="anchor" href="#connecting-everything-together">#&lt;/a>
&lt;/h2>
&lt;p>This section will show you how to connect all the hardware pieces you
have to your Odroid-C4.&lt;/p></description></item><item><title>I/O</title><link>https://lionsos.org/docs/components/io/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/components/io/</guid><description>&lt;h1 id="inputoutput">
 Input/Output
 &lt;a class="anchor" href="#inputoutput">#&lt;/a>
&lt;/h1>
&lt;p>The I/O done with LionsOS is all in user-space and is separated into components with
a single purpose.&lt;/p>
&lt;h2 id="device-drivers-and-virtualisers">
 Device Drivers and Virtualisers
 &lt;a class="anchor" href="#device-drivers-and-virtualisers">#&lt;/a>
&lt;/h2>
&lt;p>Device drivers are intended to take the hardware-specific interface with the device and
turn that into a standard interface based on its device class with the next component in the
chain, the virtualiser.&lt;/p>
&lt;p>Virtualisers are components that are responsible for taking a single connection with the driver and
multiplexing between all the client connections.&lt;/p></description></item><item><title>libc</title><link>https://lionsos.org/docs/use/language_support/libc/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/use/language_support/libc/</guid><description>&lt;h1 id="libc">
 libc
 &lt;a class="anchor" href="#libc">#&lt;/a>
&lt;/h1>
&lt;p>This page explains the LionsOS libc implementation and how to configure and
build it using the provided Makefile snippet.&lt;/p>
&lt;h2 id="overview">
 Overview
 &lt;a class="anchor" href="#overview">#&lt;/a>
&lt;/h2>
&lt;p>LionsOS uses a custom libc setup based on our
&lt;a href="https://github.com/au-ts/musllibc/tree/lionsos">fork&lt;/a> of
&lt;a href="https://musl.libc.org/">musllibc&lt;/a>. We also provide implementations of a POSIX
subset and vendored compiler runtime helpers. This setup is compatible with the
sDDF build system.&lt;/p>
&lt;p>The final &lt;code>libc.a&lt;/code> is built from three main sources:&lt;/p>
&lt;ol>
&lt;li>musllibc (our fork): Provides core libc functionality, with system calls
redirected to a general dispatcher.&lt;/li>
&lt;li>Syscall implementations: Functionality found in &lt;code>lib/libc/posix/&lt;/code>.&lt;/li>
&lt;li>Compiler runtime helpers: Low-level arithmetic and runtime support from
&lt;code>lib/libc/compiler_rt/&lt;/code>.&lt;/li>
&lt;/ol>
&lt;h3 id="available-functionality">
 Available Functionality
 &lt;a class="anchor" href="#available-functionality">#&lt;/a>
&lt;/h3>
&lt;p>Syscall implementation covers a subset of POSIX sufficient for many embedded
applications. Below is a summary of available functionality.&lt;/p></description></item><item><title>Building</title><link>https://lionsos.org/docs/examples/firewall/building/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/firewall/building/</guid><description>&lt;h1 id="building">
 Building
 &lt;a class="anchor" href="#building">#&lt;/a>
&lt;/h1>
&lt;blockquote class="book-hint info">
 
The firewall example currently relies on Microkit changes that are not part of a released version.
If you have previously setup your machine for LionsOS before make sure to follow the instructions
for acquiring the pre-release version of Microkit below.

&lt;br>
Once the next Microkit release is out, we will pin to that instead.

&lt;/blockquote>

&lt;h2 id="acquire-source-code">
 Acquire source code
 &lt;a class="anchor" href="#acquire-source-code">#&lt;/a>
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>git clone https://github.com/au-ts/lionsos.git
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd lionsos
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="dependencies">
 Dependencies
 &lt;a class="anchor" href="#dependencies">#&lt;/a>
&lt;/h2>
&lt;p>Run the following commands depending on your machine:&lt;/p></description></item><item><title>Building</title><link>https://lionsos.org/docs/examples/webserver/building/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/webserver/building/</guid><description>&lt;h1 id="building">
 Building
 &lt;a class="anchor" href="#building">#&lt;/a>
&lt;/h1>
&lt;h2 id="acquire-source-code">
 Acquire source code
 &lt;a class="anchor" href="#acquire-source-code">#&lt;/a>
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>git clone https://github.com/au-ts/lionsos.git
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd lionsos
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="dependencies">
 Dependencies
 &lt;a class="anchor" href="#dependencies">#&lt;/a>
&lt;/h2>
&lt;p>Run the following commands depending on your machine:&lt;/p>
&lt;div class="book-tabs">
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-0" checked="checked" />
&lt;label for="tabs-dependencies-0">Ubuntu/Debian&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>sudo apt update &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> sudo apt install make cmake clang lld llvm device-tree-compiler unzip git qemu-system-arm python3 python3-pip
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># If you see &amp;#39;error: externally-managed-environment&amp;#39;, add --break-system-packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pip3 install sdfgen&lt;span style="color:#f92672">==&lt;/span>0.26.0
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-1" />
&lt;label for="tabs-dependencies-1">macOS&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Make sure that you add the LLVM bin directory to your path.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># For example:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># echo export PATH=&amp;#34;/opt/homebrew/Cellar/llvm/bin:$PATH&amp;#34; &amp;gt;&amp;gt; ~/.zshrc&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Homebrew will print out the correct path to add&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>brew install make dtc llvm qemu
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># If you see &amp;#39;error: externally-managed-environment&amp;#39;, add --break-system-packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pip3 install sdfgen&lt;span style="color:#f92672">==&lt;/span>0.26.0
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-2" />
&lt;label for="tabs-dependencies-2">Arch&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>sudo pacman -Sy make clang lld dtc python3 python-pip
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># If you see &amp;#39;error: externally-managed-environment&amp;#39;, add --break-system-packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pip3 install sdfgen&lt;span style="color:#f92672">==&lt;/span>0.26.0
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-3" />
&lt;label for="tabs-dependencies-3">Nix&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>nix develop
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;/div>
&lt;h3 id="acquire-the-microkit-sdk">
 Acquire the Microkit SDK
 &lt;a class="anchor" href="#acquire-the-microkit-sdk">#&lt;/a>
&lt;/h3>
&lt;p>Run the following commands depending on your machine:&lt;/p></description></item><item><title>Integration</title><link>https://lionsos.org/docs/use/integration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/use/integration/</guid><description>&lt;h1 id="integration">
 Integration
 &lt;a class="anchor" href="#integration">#&lt;/a>
&lt;/h1>
&lt;p>Due to LionsOS being a &lt;em>component&lt;/em> Operating System, part of the process of developing
on top of LionsOS involves picking and integrating the various components and sub-systems
that you want to be part of your final system.&lt;/p>
&lt;p>This brings up a problem of how, as the system designer, do you put everything together
without spending a lot of time getting familiar with the LionsOS components themselves?&lt;/p>
&lt;p>In a Microkit based system, in order to get the final bootable image for your hardware, the Microkit
tool expects you to produce two artefacts:&lt;/p></description></item><item><title>Debugging</title><link>https://lionsos.org/docs/use/debugging/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/use/debugging/</guid><description>&lt;h1 id="debugging">
 Debugging
 &lt;a class="anchor" href="#debugging">#&lt;/a>
&lt;/h1>
&lt;p>The current debugging experience with LionsOS systems is quite tedious as the only options for debugging
are to insert &lt;code>printf&lt;/code>s or looking at the object dump if a certain protection domain faulted at an address.&lt;/p>
&lt;p>While simulators such as QEMU offer debugging support with GDB, those debugging on hardware cannot attach
a debugger.&lt;/p>
&lt;p>We have been working to add first-class GDB support to LionsOS so you can do things like single-stepping
over code, set breakpoints and read the state of a program.&lt;/p></description></item><item><title>Running (QEMU)</title><link>https://lionsos.org/docs/examples/webserver/running_qemu/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/webserver/running_qemu/</guid><description>&lt;h2 id="running-on-qemu">
 Running on QEMU
 &lt;a class="anchor" href="#running-on-qemu">#&lt;/a>
&lt;/h2>
&lt;p>To start QEMU, run the following command in the same place you compiled the system:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>make qemu
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You should see the following lines at the bottom of your output:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>nfs: nfs.c:47:nfs_connect_cb: connected to nfs server
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Starting async server on 0.0.0.0:80...
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The IP address that the webserver starts on &lt;code>0.0.0.0:80&lt;/code> is relative to QEMU&amp;rsquo;s internal network,
and is not visible from your host computer.&lt;/p>
&lt;p>Instead, for connecting outside of QEMU (e.g in your browser), you want to go to
port 5555 of localhost (e.g &lt;code>localhost:5555&lt;/code> in your browser).&lt;/p></description></item><item><title>Profiling</title><link>https://lionsos.org/docs/use/profiling/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/use/profiling/</guid><description>&lt;h1 id="profiling">
 Profiling
 &lt;a class="anchor" href="#profiling">#&lt;/a>
&lt;/h1>
&lt;p>In order to determine and analyse the performance of a LionsOS system, we need a systematic
way of recording where CPU time is spent.&lt;/p>
&lt;p>We achieve this with a statistical profiler, which means that we take regular samples of the
Performance Monitor Unit (PMU) hardware to determine how much CPU time a particular Protection
Domain (PD) is using.&lt;/p>
&lt;h2 id="availability">
 Availability
 &lt;a class="anchor" href="#availability">#&lt;/a>
&lt;/h2>
&lt;p>All the work relating to profiling support can be found &lt;a href="https://github.com/au-ts/sel4_profiler">here&lt;/a>.&lt;/p></description></item><item><title>Reference system (Kitty)</title><link>https://lionsos.org/docs/components/virtual_machines/api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/components/virtual_machines/api/</guid><description>&lt;h1 id="libvmm-api">
 libvmm API
 &lt;a class="anchor" href="#libvmm-api">#&lt;/a>
&lt;/h1>
&lt;p>The virtual machine library (libvmm) provides the following interfaces.&lt;/p>
&lt;h2 id="uintptr_t-linux_setup_imagesuintptr_t-ram_start-uintptr_t-kernel-size_t-kernel_size-uintptr_t-dtb_src-uintptr_t-dtb_dest-size_t-dtb_size-uintptr_t-initrd_src-uintptr_t-initrd_dest-size_t-initrd_size">
 &lt;code>uintptr_t linux_setup_images(uintptr_t ram_start, uintptr_t kernel, size_t kernel_size, uintptr_t dtb_src, uintptr_t dtb_dest, size_t dtb_size, uintptr_t initrd_src, uintptr_t initrd_dest, size_t initrd_size)&lt;/code>
 &lt;a class="anchor" href="#uintptr_t-linux_setup_imagesuintptr_t-ram_start-uintptr_t-kernel-size_t-kernel_size-uintptr_t-dtb_src-uintptr_t-dtb_dest-size_t-dtb_size-uintptr_t-initrd_src-uintptr_t-initrd_dest-size_t-initrd_size">#&lt;/a>
&lt;/h2>
&lt;p>&lt;code>linux_setup_images&lt;/code> is used to copy Linux kernel, initial RAM disc
and device tree into guest RAM ready for execution. The first
argument &lt;em>ram_start&lt;/em> is the virtual address of the guest RAM.&lt;/p>
&lt;p>The memory pointed to by &lt;em>kernel&lt;/em> is checked to see that it is a Linux
image before it is copied into an appropriate place in the guest RAM.&lt;/p></description></item><item><title>Running (hardware)</title><link>https://lionsos.org/docs/examples/webserver/running_hardware/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/webserver/running_hardware/</guid><description>&lt;h2 id="running-on-hardware">
 Running on hardware
 &lt;a class="anchor" href="#running-on-hardware">#&lt;/a>
&lt;/h2>
&lt;p>The webserver has several Mac-address endpoints, that need to be known by
several components. It expects to be run while connected to a network
with a DHCP server that will hand out IPv4 addresses corresponding to
each of the Mac addresses.&lt;/p>
&lt;p>At the time of writing, the MAC addresses are:&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th style="text-align: left">Component&lt;/th>
 &lt;th style="text-align: center">MAC&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td style="text-align: left">NFS&lt;/td>
 &lt;td style="text-align: center">52:54:1:0:0:10&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">MicroPython&lt;/td>
 &lt;td style="text-align: center">52:54:1:0:0:11&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>The webserver needs an NFSv3 server, whose address is known at build
time. Its MicroPython interpreter can import python modules from the
NFS filesystem. The NFSv3 server has to be set up to export to
whatever IP address the NFS component is given by DHCP.&lt;/p></description></item><item><title>Running on hardware</title><link>https://lionsos.org/docs/examples/firewall/running/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/firewall/running/</guid><description>&lt;h1 id="running-on-hardware">
 Running on hardware
 &lt;a class="anchor" href="#running-on-hardware">#&lt;/a>
&lt;/h1>
&lt;p>To effectively test the firewall system when running on real hardware, each
network interface must be connected to a distinct subnet with the firewall being
the only means to achieve communication between the subnets. Hosts on each
subnet must then be configured to forward non-local traffic to the firewall.&lt;/p>
&lt;p>Unlike most LionsOS systems which use software defined MAC addresses, the
firewall uses the MAC address of each NIC (although the &lt;a href="https://github.com/au-ts/lionsos/issues/185">software still requires
knowledge of this&lt;/a>).&lt;/p></description></item><item><title>Running on QEMU inside Docker</title><link>https://lionsos.org/docs/examples/firewall/docker/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/firewall/docker/</guid><description>&lt;h1 id="running-on-qemu-inside-docker">
 Running on QEMU inside Docker
 &lt;a class="anchor" href="#running-on-qemu-inside-docker">#&lt;/a>
&lt;/h1>
&lt;p>Although the firewall can be run on QEMU natively, to test it effectively it
requires a more complicated networking backend than is typically required when
using QEMU. The default QEMU network backend
&lt;a href="https://wiki.qemu.org/Documentation/Networking">SLIRP&lt;/a> implements a virtual
NAT&amp;rsquo;d network with very little configurability. The better, more versatile
option is to use a TAP network backend which supplies QEMU with a virtual NIC,
and allows the host to configure the desired network topology. The problem with
this is that configuring this network topology is very dependent on the
operating system of the host, and in the case of macOS creating a TAP network
interface is no longer supported, or at least not without the use of kernel
extensions.&lt;/p></description></item><item><title>Testing</title><link>https://lionsos.org/docs/examples/firewall/testing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/firewall/testing/</guid><description>&lt;h1 id="testing-the-firewall">
 Testing the firewall
 &lt;a class="anchor" href="#testing-the-firewall">#&lt;/a>
&lt;/h1>
&lt;p>This page describes how to test all the currently implemented functionalities of
the firewall. The tests are for the QEMU platform, to be run inside the provided
&lt;a href="../docker">Docker container&lt;/a>, however similar commands and tests can be used
for a real hardware setup.&lt;/p>
&lt;h2 id="testing-the-qemu-image-in-docker">
 Testing the QEMU image in Docker
 &lt;a class="anchor" href="#testing-the-qemu-image-in-docker">#&lt;/a>
&lt;/h2>
&lt;p>The following commands reference environment variables set using the
configuration script &lt;code>firewall_configuration.sh&lt;/code>. If you are running the
commands inside the container, these variables should &lt;a href="../docker">already be
set&lt;/a>.&lt;/p></description></item><item><title>Contributing</title><link>https://lionsos.org/docs/examples/firewall/contributing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://lionsos.org/docs/examples/firewall/contributing/</guid><description>&lt;h1 id="contributing-to-the-firewall">
 Contributing to the firewall
 &lt;a class="anchor" href="#contributing-to-the-firewall">#&lt;/a>
&lt;/h1>
&lt;p>Currently the firewall example is in early stages of development, missing many
of the basic features expected of a firewall. We consider this a community
project and are inviting interested people to contribute to it and help improve
its functionality and usability.&lt;/p>
&lt;p>We have an extensive list of GitHub
&lt;a href="https://github.com/au-ts/lionsos/issues?q=is%3Aissue%20state%3Aopen%20label%3Afirewall">issues&lt;/a>
we are currently tracking with the firewall, starting from minor improvements to
our implementation. Issues with the firewall example are all tagged with the
&lt;code>firewall&lt;/code> label. Three other labels are used to categorise the issues:&lt;/p></description></item><item><title>Building</title><link>https://lionsos.org/docs/examples/kitty/building/</link><pubDate>Tue, 12 Dec 2023 21:00:47 +1100</pubDate><guid>https://lionsos.org/docs/examples/kitty/building/</guid><description>&lt;h1 id="building-the-kitty-system">
 Building the Kitty system
 &lt;a class="anchor" href="#building-the-kitty-system">#&lt;/a>
&lt;/h1>
&lt;h2 id="acquire-source-code">
 Acquire source code
 &lt;a class="anchor" href="#acquire-source-code">#&lt;/a>
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>git clone https://github.com/au-ts/lionsos.git
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd lionsos
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="dependencies">
 Dependencies
 &lt;a class="anchor" href="#dependencies">#&lt;/a>
&lt;/h2>
&lt;p>Run the following commands depending on your machine:&lt;/p>
&lt;div class="book-tabs">
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-0" checked="checked" />
&lt;label for="tabs-dependencies-0">Ubuntu/Debian&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>sudo apt update &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> sudo apt install make cmake clang lld llvm device-tree-compiler unzip git qemu-system-arm python3 python3-pip
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># If you see &amp;#39;error: externally-managed-environment&amp;#39;, add --break-system-packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pip3 install sdfgen&lt;span style="color:#f92672">==&lt;/span>0.26.0
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-1" />
&lt;label for="tabs-dependencies-1">macOS&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Make sure that you add the LLVM bin directory to your path.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># For example:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># echo export PATH=&amp;#34;/opt/homebrew/Cellar/llvm/bin:$PATH&amp;#34; &amp;gt;&amp;gt; ~/.zshrc&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Homebrew will print out the correct path to add&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>brew install make dtc llvm qemu
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># If you see &amp;#39;error: externally-managed-environment&amp;#39;, add --break-system-packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pip3 install sdfgen&lt;span style="color:#f92672">==&lt;/span>0.26.0
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-2" />
&lt;label for="tabs-dependencies-2">Arch&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>sudo pacman -Sy make clang lld dtc python3 python-pip
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># If you see &amp;#39;error: externally-managed-environment&amp;#39;, add --break-system-packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pip3 install sdfgen&lt;span style="color:#f92672">==&lt;/span>0.26.0
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;input type="radio" class="toggle" name="tabs-dependencies" id="tabs-dependencies-3" />
&lt;label for="tabs-dependencies-3">Nix&lt;/label>
&lt;div class="book-tabs-content markdown-inner">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>nix develop
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;/div>
&lt;h3 id="acquire-the-microkit-sdk">
 Acquire the Microkit SDK
 &lt;a class="anchor" href="#acquire-the-microkit-sdk">#&lt;/a>
&lt;/h3>
&lt;p>Run the following commands depending on your machine:&lt;/p></description></item><item><title>Running</title><link>https://lionsos.org/docs/examples/kitty/running/</link><pubDate>Tue, 12 Dec 2023 21:00:47 +1100</pubDate><guid>https://lionsos.org/docs/examples/kitty/running/</guid><description>&lt;h1 id="running">
 Running
 &lt;a class="anchor" href="#running">#&lt;/a>
&lt;/h1>
&lt;p>The Kitty has several Mac-address endpoints, that need to be known by
several components. It expects to be run while connected to a network
with a DHCP server that will hand out IPv4 addresses corresponding to
each of the Mac addresses.&lt;/p>
&lt;p>As at the time of writing, the MAC addresses are:&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th style="text-align: left">Component&lt;/th>
 &lt;th style="text-align: center">MAC&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td style="text-align: left">NFS&lt;/td>
 &lt;td style="text-align: center">52:54:1:0:0:10&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">MicroPython&lt;/td>
 &lt;td style="text-align: center">52:54:1:0:0:11&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>The Kitty needs an NFSv3 server, whose address is known at build
time. Its MicroPython interpreter can import python modules from the
NFS filesystem. The NFSv3 server has to be set up to export to
whatever IP address the NFS component is given by DHCP.&lt;/p></description></item></channel></rss>