Skip to content

Commit

Permalink
address Gerwin's comments on setting-up page
Browse files Browse the repository at this point in the history
Signed-off-by: Birgit Brecknell <[email protected]>
  • Loading branch information
bbrcknl committed Jul 15, 2024
1 parent e8ff93d commit 42b9c6c
Showing 1 changed file with 21 additions and 101 deletions.
122 changes: 21 additions & 101 deletions Tutorials/seL4/setting-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,24 @@ SPDX-FileCopyrightText: 2024 seL4 Project a Series of LF Projects, LLC.
---

# Setting up your machine
**Overview**
- Set up your machine - install dependencies required to run seL4``
- Run seL4test on a simulator
- Gain awareness of terminology used for seL4

## Google's Repo tool

The primary way of obtaining and managing seL4 project sources is through the use of Google's Repo tool.

To install run:
```sh
sudo apt-get update
sudo apt-get install repo
```

<details markdown='1'>
<summary style="display:list-item">More on Repo</summary>
<br>
[More details about on installing Repo](https://source.android.com/setup/develop#installing-repo).

[seL4 Repo cheatsheet](../projects/buildsystem/repo-cheatsheet)
</details>

## Docker
To compile and use seL4, it is recommended that you use Docker to isolate the dependencies from your machine.
Expand Down Expand Up @@ -49,100 +61,8 @@ sudo usermod -aG docker $(whoami)
</details>


## Google's Repo tool

The primary way of obtaining and managing seL4 project sources is through the use of Google's Repo tool.

To install run:
```sh
sudo apt-get update
sudo apt-get install repo
```

<details markdown='1'>
<summary style="display:list-item">More on Repo</summary>
<br>
[More details about on installing Repo](https://source.android.com/setup/develop#installing-repo).

[seL4 Repo cheatsheet](../projects/buildsystem/repo-cheatsheet)
</details>


## Base build dependencies
To establish a usable development environment it is important to install your distributions basic build packages.

### Base dependencies

The basic build package on Ubuntu is the `build-essential` package. To install run:

```sh
sudo apt-get update
sudo apt-get install build-essential
```

Additional base dependencies for building seL4 projects on Ubuntu include installing:

```sh
sudo apt-get install cmake ccache ninja-build cmake-curses-gui
sudo apt-get install libxml2-utils ncurses-dev
sudo apt-get install curl git doxygen device-tree-compiler
sudo apt-get install u-boot-tools
sudo apt-get install python3-dev python3-pip python-is-python3
sudo apt-get install protobuf-compiler python3-protobuf
```

### Simulating with QEMU

To run seL4 projects on a simulator you will need QEMU. QEMU is a generic and open source machine emulator and virtualizer, and can emulate different architectures on different systems.


```sh
sudo apt-get install qemu-system-arm qemu-system-x86 qemu-system-misc
```

### Cross-compiling for ARM targets

To build for ARM targets you will need a cross compiler:

```sh
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
```

(you can install the hardware floating point versions as well if you wish)

```sh
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
```

### Cross-compiling for RISC-V targets

To build for RISC-V targets you will need a cross compiler:

{% include risc-v.md %}


<details markdown='1'>
<summary style="display:list-item">More on host dependencies</summary>
<br>
[A detailed guide on host dependencies](../projects/buildsystem/host-dependencies)
</details>


## Python Dependencies

Regardless of your Linux distribution, python dependencies are required to build seL4, the manual and its proofs. To install you can run:

```sh
pip3 install --user setuptools
pip3 install --user sel4-deps
```

(Some distributions use `pip` for python3, others use `pip3`. Use the Python 3 version for your distribution.)


## Getting a build environment
To get a running build environment for seL4 and Camkes, run:
### Getting a build environment
To get a running build environment for seL4 and CAmkES, run:

```bash
git clone https://github.com/seL4/seL4-CAmkES-L4v-dockerfiles.git
Expand All @@ -160,7 +80,7 @@ The last line will say something like:
Hello, welcome to the seL4/CAmkES/L4v docker build environment
```

## Mapping a container
### Mapping a container
To run the container from other directories (e.g. starting a container for the [Hello World](hello-world) tutorial, which we'll do next), you can setup a bash alias such as this:

```bash
Expand All @@ -173,7 +93,7 @@ Replace `/<path>/<to>/` to match where you cloned the git repo of the docker fil
*Reminder:* Include the absolute path to your `seL4-CAmkES-L4v-dockerfiles` folder, e.g.

```bash
echo $'alias container=\'make -C //home/jblogs/seL4-CAmkES-L4v-dockerfiles user HOST_DIR=$(pwd)\'' >> ~/.bashrc
echo $'alias container=\'make -C /~/seL4-CAmkES-L4v-dockerfiles user HOST_DIR=$(pwd)\'' >> ~/.bashrc
# now open a new terminal, or run `source ~/.bashrc`

```
Expand Down Expand Up @@ -219,7 +139,7 @@ jblogs@in-container:/host/build-x86$ ./simulate

If you need to make any code modifications or commit things to git, use terminal A. If you need to recompile or simulate an image, use terminal B.

`./simulate` will take a few minutes to run. If QEMU works, you'll see something like
`./simulate` is run using [QEMU](https://www.qemu.org/), and will take a few minutes to run. If QEMU works, you'll see something like

```
Test suite passed. 121 tests passed. 57 tests disabled.
Expand Down

0 comments on commit 42b9c6c

Please sign in to comment.