Part 0 - Setting up your environment

This page covers two things:

  1. Acquiring the Microkit SDK and the other dependencies needed for the tutorial.
  2. Acquiring the tutorial code, so you can complete the exercises.

If you have any issues, feel free to open an issue on the GitHub repository.

Acquiring the dependencies

We have two options for working on the tutorial:

  1. Install dependencies and do the tutorial natively, however this option is only available if you are doing the tutorial on Linux or macOS.
  1. If you prefer to use Docker or are not on Linux/macOS, you can follow the instructions for Docker.

Option 1 - Native (Linux and macOS)

You'll need the following dependencies:

  • Make
  • AAarch64 cross compiler
  • QEMU simulator for running the tutorials
  • The Microkit SDK

Linux setup

On Ubuntu/Debian with apt you can use the following command:

sudo apt-get update && sudo apt-get install -y make gcc-aarch64-linux-gnu qemu-system-arm

On Arch Linux or other distributions that use pacman:

sudo pacman -Sy make aarch64-linux-gnu-gcc qemu-system-aarch64

On Fedora with dnf use the following command:

sudo dnf install -y make qemu gcc-aarch64-linux-gnu

You can get the SDK with:

# First make a directory for the tutorial
mkdir microkit_tutorial
cd microkit_tutorial
# Then download and extract the SDK
curl -L https://github.com/seL4/microkit/releases/download/1.4.0/microkit-sdk-1.4.0-linux-x86-64.tar.gz -o sdk.tar.gz
tar xf sdk.tar.gz

macOS setup

You can install the dependencies using Homebrew:

brew tap messense/macos-cross-toolchains
brew install make qemu aarch64-unknown-linux-gnu

For Apple Silicon (ARM64) Macs to get the SDK you can do the following:

# First make a directory for the tutorial
mkdir microkit_tutorial
cd microkit_tutorial
# Then download and extract the SDK
curl -L https://github.com/seL4/microkit/releases/download/1.4.0/microkit-sdk-1.4.0-macos-aarch64.tar.gz -o sdk.tar.gz
tar xf sdk.tar.gz

For Intel (x86) Macs to get the SDK you can do the following:

# First make a directory for the tutorial
mkdir microkit_tutorial
cd microkit_tutorial
# Then download and extract the SDK
curl -L https://github.com/seL4/microkit/releases/download/1.4.0/microkit-sdk-1.4.0-macos-x86-64.tar.gz -o sdk.tar.gz
tar xf sdk.tar.gz

Option 2 - Docker

seL4 provides an official Docker container which has the necessary dependencies for this tutorial. You can find instructions for acquring it here.

After setting up the Docker container, run the following commands outside Docker:

# First make a directory for the tutorial
mkdir microkit_tutorial
cd microkit_tutorial
# Then start the Docker container
container
# Then download and extract the SDK
curl -L https://github.com/seL4/microkit/releases/download/1.4.0/microkit-sdk-1.4.0-linux-x86-64.tar.gz -o sdk.tar.gz
tar xf sdk.tar.gz

This Docker image is mounted on your host file system. What that means is that the microkit_tutorial directory is accessible from both Docker and from your normal environment.

Run all the commands for downloading the tutorial code and building/running the tutorial in the container. You can then open the microkit_tutorial directory in your code editor for viewing/editing the tutorial code.

Getting the tutorial code

# Download and extract the tutorial code (in the microkit_tutorial directory)
curl -L trustworthy.systems/Downloads/microkit_tutorial/tutorial.tar.gz -o tutorial.tar.gz
tar xf tutorial.tar.gz

Now you can move on to part 1 of the tutorial.