diff --git a/Hardware/Beaglebone.md b/Hardware/Beaglebone.md index 2622fc0e17..a0c2fbad5f 100644 --- a/Hardware/Beaglebone.md +++ b/Hardware/Beaglebone.md @@ -27,7 +27,7 @@ a community-supported port. ### Requirements We suggest using the `arm-linux-gnueabi-` cross-compilers. Use -[the instructions on getting a toolchain](/GettingStarted#getting-cross-compilers). +[the instructions on getting a toolchain](/Resources#getting-cross-compilers). ### Building diff --git a/Hardware/HiKey/index.md b/Hardware/HiKey/index.md index 2b74590f93..8e659cb92e 100644 --- a/Hardware/HiKey/index.md +++ b/Hardware/HiKey/index.md @@ -23,7 +23,7 @@ SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. - One HiKey Board. See [Hikey 96Board](http://www.96boards.org/products/ce/hikey/) - Fully working development environment. See - [Getting started](/GettingStarted) + [Resources](/Resources) ### Getting Started The Hikey board is based around the @@ -87,12 +87,12 @@ gedit LinaroPkg/platforms.config BUILDFLAGS=-DSERIAL_BASE=0xF8015000 ATF_BUILDFLAGS=CONSOLE_BASE=PL011_UART0_BASE CRASH_CONSOLE_BASE=PL011_UART0_BASE ``` -## 5. Patching the UEFI for the Hikey +## 5. Patching the UEFI for the Hikey Obtain the patch from [edk2.patch](edk2.patch) and follow the below steps. ```bash -cd linaro-edk2 -patch -p1 < ~/Downloads/edk2.patch +cd linaro-edk2 +patch -p1 < ~/Downloads/edk2.patch # Then return to the main directory hikey-flash ``` @@ -206,8 +206,8 @@ sudo minicom -s 7. Three terminals are then required for the following commands ```bash -# In the first terminal -ls +# In the first terminal +ls # Note the next ttyUSBY that is observed, in addition to the current ttyUSBX # In the third terminal diff --git a/Hardware/VMware/index.md b/Hardware/VMware/index.md index 5ce4187429..811ee73277 100644 --- a/Hardware/VMware/index.md +++ b/Hardware/VMware/index.md @@ -14,7 +14,7 @@ and for a Linux host machine. May work on Mac host machine, won't work for Windows host (although general idea should be similar). This guide assumes that your project is all set up and configured to -build for x86. Read [Getting started](/GettingStarted) otherwise. +build for x86. Read [Resources](/Resources) otherwise. ## Setting up a VM @@ -55,7 +55,7 @@ There are three options for the serial port set up). You'll want to apt-get install socat and then run something like: ```bash -#!/bin/bash +#!/bin/bash while true; do socat -d -d UNIX-CONNECT:/tmp/vsock,forever PTY:link=/dev/tty99 done diff --git a/Hardware/jetsontk1.md b/Hardware/jetsontk1.md index 5f7d1e981f..e5ac578a4a 100644 --- a/Hardware/jetsontk1.md +++ b/Hardware/jetsontk1.md @@ -20,10 +20,10 @@ SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. The [Jetson TK1](http://www.nvidia.com/object/jetson-tk1-embedded-dev-kit.html) is a affordable embedded system developed by NVIDIA. It runs seL4. We will explain how to run seL4 on the Tegra. - + ### Pre-Requisites * One Tegra Board. See [Jetson TK1](http://www.nvidia.com/object/jetson-tk1-embedded-dev-kit.html) -* The development environment fully working. See [Getting started](/GettingStarted) +* The development environment fully working. See [Resources](/Resources) ## Getting Started To get started, check out the @@ -94,7 +94,7 @@ to boot in nonsecure (HYP) mode. This also enables kvm if you boot Linux. To go back to secure mode booting do -``` +``` setenv bootm_boot_mode sec saveenv ``` diff --git a/Makefile b/Makefile index e2a1118a47..0863471a5e 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,10 @@ _repos/tutes: _repos/tutes/%.md: _repos/sel4proj/sel4-tutorials/tutorials/% _repos/tutes PYTHONPATH=_repos/sel4/capdl/python-capdl-tool _repos/sel4proj/sel4-tutorials/template.py --docsite --out-dir _repos/tutes --tut-file $sel4-tutorials-manifest. Get the code with: +``` +mkdir sel4-tutorials-manifest +cd sel4-tutorials-manifest +repo init -u https://github.com/seL4/sel4-tutorials-manifest +repo sync +``` + +`repo sync` may take a few moments to run + +*Hint:* The **Get the code** step only needs to be done once, i.e. before doing your first tutorial. + +

+ Next: Hello world +

diff --git a/Tutorials/hello-camkes-0.md b/Tutorials/hello-camkes-0.md index e2d52f9d88..692f565545 100644 --- a/Tutorials/hello-camkes-0.md +++ b/Tutorials/hello-camkes-0.md @@ -1,11 +1,9 @@ --- toc: true -title: Camkes +title: Hello CAmkES tutorial: hello-camkes-0 -tutorial-order: camkes-0 -description: an introduction to Camkes concepts. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/hello-camkes-1.md b/Tutorials/hello-camkes-1.md index 2fbbf4786c..37d2a54a92 100644 --- a/Tutorials/hello-camkes-1.md +++ b/Tutorials/hello-camkes-1.md @@ -1,11 +1,9 @@ --- toc: true -title: Camkes 1 +title: Introduction to CAmkES tutorial: hello-camkes-1 -tutorial-order: camkes-1 -description: an introduction to Camkes concepts. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/hello-camkes-2.md b/Tutorials/hello-camkes-2.md index 4cf55e8411..110cdf631f 100644 --- a/Tutorials/hello-camkes-2.md +++ b/Tutorials/hello-camkes-2.md @@ -1,11 +1,9 @@ --- toc: true -title: Camkes 2 +title: Events in CAmkES tutorial: hello-camkes-2 -tutorial-order: camkes-2 -description: an introduction to Camkes concepts. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/hello-camkes-timer.md b/Tutorials/hello-camkes-timer.md index bfd34499fc..852127779f 100644 --- a/Tutorials/hello-camkes-timer.md +++ b/Tutorials/hello-camkes-timer.md @@ -1,11 +1,9 @@ --- toc: true -title: Camkes 3 +title: CAmkES timer tutorial tutorial: hello-camkes-timer -tutorial-order: camkes-3 -description: introduce Camkes hardware components. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/hello-world.md b/Tutorials/hello-world.md index 1a8adf4dbc..0abae7c64f 100644 --- a/Tutorials/hello-world.md +++ b/Tutorials/hello-world.md @@ -2,9 +2,9 @@ toc: true title: Hello, World! tutorial: hello-world -tutorial-order: 0-hello -description: an introduction to seL4 projects and tutorials. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- + {% include tutorial.md %} diff --git a/Tutorials/how-to.md b/Tutorials/how-to.md new file mode 100644 index 0000000000..4f37283517 --- /dev/null +++ b/Tutorials/how-to.md @@ -0,0 +1,200 @@ +--- +toc: true +layout: tutorial +SPDX-License-Identifier: CC-BY-SA-4.0 +SPDX-FileCopyrightText: 2024 seL4 Project a Series of LF Projects, LLC. +--- +# How to: A quick solutions guide +This guide provides links to tutorial solutions as quick references for seL4 calls and methods. + +[//]: # (Show me some foo) + +## The seL4 kernel + +{% assign url = "capabilities?tut_expand" %} +### [Capabilities]({{ url }}) + + - [Calculate the size of a CSpace]({{ url }}#how-big-is-your-cspace) + - [Copy a capability between CSlots]({{ url }}#copy-a-capability-between-cslots) + - [Delete a capability]({{ url }}#how-do-you-delete-capabilities) + - [Suspend a thread]({{ url }}#suspend-a-thread) + +{% assign url = "untyped?tut_expand" %} +### [Untyped]({{ url }}) + + - [Create an untyped capability]({{ url }}#create-an-untyped-capability) + - [Create a TCB object]({{ url }}#create-a-tcb-object) + - [Create an endpoint object]({{ url }}#create-an-endpoint-object) + - [Create a notification object]({{ url }}#create-a-notification-object) + - [Delete an object]({{ url }}#delete-the-objects) + +{% assign url = "mapping?tut_expand" %} +### [Mapping]({{ url }}) +- [Map a page directory]({{ url }}#map-a-page-directory) +- [Map a page table]({{ url }}#map-a-page-table) +- [Remap a page]({{ url }}#remap-a-page) +- [Unmap a page]({{ url }}#unmapping-pages) + +{% assign url = "threads?tut_expand" %} +### [Threads]({{ url }}) +- [Configure a TCB]({{ url }}#configure-a-tcb) +- [Change the priority of a thread]({{ url }}#change-priority-via-sel4_tcb_setpriority) +- [Set initial register state]({{ url }}#set-initial-register-state) +- [Start the thread]({{ url }}#start-the-thread) +- [Set the arguments of a thread]({{ url }}#passing-arguments) +- [Resolve a fault]({{ url }}#resolving-a-fault) + +{% assign url = "ipc?tut_expand" %} +### [IPC]({{ url }}) + - [Use capability transfer to send the badged capability]({{ url }}#use-capability-transfer-to-send-the-badged-capability) + - [Get a message]({{ url }}#get-a-message) + - [Reply and wait]({{ url }}#reply-and-wait) + - [Save a reply and store reply capabilities]({{ url }}#save-a-reply-and-store-reply-capabilities) + +{% assign url = "notifications?tut_expand" %} +### [Notifications]({{ url }}) + - [Set up shared memory]({{ url }}#set-up-shared-memory) + - [Signalling]({{ url }}#signal-the-producers-to-go) + - [Differentiate signals]({{ url }}#differentiate-signals) + +{% assign url = "interrupts?tut_expand" %} +### [Interrupts]({{ url }}) + - [Invoke IRQ control]({{ url }}#invoke-irq-control) + - [Set NTFN]({{ url }}#set-ntfn) + - [Acknowledge an interrupt]({{ url }}#acknowledge-an-interrupt) + +{% assign url = "fault-handlers?tut_expand" %} +### [Fault handling]({{ url }}) + - [Set up an endpoint for thread fault IPC messages]({{ url }}#setting-up-the-endpoint-to-be-used-for-thread-fault-ipc-messages) + - [Receive an IPC message from the kernel]({{ url }}#receiving-the-ipc-message-from-the-kernel) + - [Get information about a thread fault]({{ url }}#finding-out-information-about-the-generated-thread-fault) + - [Handle a thread fault]({{ url }}#handling-a-thread-fault) + - [Resume a faulting thread]({{ url }}#resuming-a-faulting-thread) + +{% assign url = "mcs?tut_expand" %} +## [MCS Extensions]({{ url }}) + - [Set up a periodic thread]({{ url }}#periodic-threads) + - [Unbind a scheduling context]({{ url }}#unbinding-scheduling-contexts) + - [Experiment with sporadic tasks]({{ url }}#sporadic-threads) + - [Use passive servers]({{ url }}#passive-servers) + - [Configure fault endpoints]({{ url }}#configuring-a-fault-endpoint-on-the-mcs-kernel) + +{% assign url = "libraries-1?tut_expand" %} +## [Dynamic libraries]({{ url }}) + +### [Initialisation & threading]({{ url }}) + - [Obtain BootInfo]({{ url }}#obtain-bootinfo) + - [Initialise simple]({{ url }}#initialise-simple) + - [Use simple to print BootInfo]({{ url }}#use-simple-to-print-bootinfo) + - [Initialise an allocator]({{ url }}#initialise-an-allocator) + - [Obtain a generic allocation interface (vka)]({{ url }}#obtain-a-generic-allocation-interface-vka) + - [Find the CSpace root cap]({{ url }}#find-the-cspace-root-cap) + - [Find the VSpace root cap]({{ url }}#find-the-vspace-root-cap) + - [Allocate a TCB Object]({{ url }}#allocate-a-tcb-object) + - [Configure the new TCB]({{ url }}#configure-the-new-tcb) + - [Name the new TCB]({{ url }}#name-the-new-tcb) + - [Set the instruction pointer]({{ url }}#set-the-instruction-pointer) + - [Set the stack pointer]({{ url }}#set-the-stack-pointer) + - [Write the registers]({{ url }}#write-the-registers) + - [Start the new thread]({{ url }}#start-the-new-thread) + - [Print]({{ url }}#print-something) + +{% assign url = "libraries-2?tut_expand" %} +### [IPC]({{ url }}) + - [Allocate an IPC buffer]({{ url }}#allocate-an-ipc-buffer) + - [Allocate a page table]({{ url }}#allocate-a-page-table) + - [Map a page table]({{ url }}#map-a-page-table) + - [Map a page]({{ url }}#map-a-page) + - [Allocate an endpoint]({{ url }}#allocate-an-endpoint) + - [Badge an endpoint]({{ url }}#badge-an-endpoint) + - [Set a message register]({{ url }}#message-registers) + - [Send and wait for a reply]({{ url }}#ipc) + - [Receive a reply]({{ url }}#receive-a-reply) + - [Receive an IPC]({{ url }}#receive-an-ipc) + - [Validate a message]({{ url }}#validate-the-message) + - [Write the message registers]({{ url }}#write-the-message-registers) + - [Reply to a message]({{ url }}#reply-to-a-message) + +{% assign url = "libraries-3?tut_expand" %} +### [Processes & Elf loading]({{ url }}) + - [Create a VSpace object]({{ url }}#virtual-memory-management) + - [Configure a process]({{ url }}#configure-a-process) + - [Get a CSpace path]({{ url }}#get-a-cspacepath) + - [Badge a capability]({{ url }}#badge-a-capability) + - [Spawn a process]({{ url }}#spawn-a-process) + - [Receive a message]({{ url }}#receive-a-message) + - [Send a reply]({{ url }}#send-a-reply) + - [Initiate communications by using seL4_Call]({{ url }}#client-call) + +{% assign url = "libraries-4?tut_expand" %} +### [Timer]({{ url }}) + - [Allocate a notification object]({{ url }}#allocate-a-notification-object) + - [Initialise a timer]({{ url }}#initialise-the-timer) + - [Use a timer]({{ url }}#use-the-timer) + - [Handle an interrupt]({{ url }}#handle-the-interrupt) + - [Destroy a timer]({{ url }}#destroy-the-timer) + +## [CAmkES](hello-camkes-0?tut_expand) + +{% assign url = "hello-camkes-1?tut_expand" %} +### [A basic CAmkES application]({{ url }}) + - [Define an instance in the composition section of the ADL]({{ url }}#define-an-instance-in-the-composition-section-of-the-adl) + - [Add a connection]({{ url }}#add-a-connection) + - [Define an interface]({{ url }}#define-an-interface) + - [Implement an RPC function]({{ url }}#implement-a-rpc-function) + - [Invoke a RPC function]({{ url }}#invoke-a-rpc-function) + +{% assign url = "hello-camkes-2?tut_expand" %} +### [Events in CAmkES]({{ url }}) + - [Specify an events interface]({{ url }}#specify-an-events-interface) + - [Add connections]({{ url }}#add-connections) + - [Wait for data to become available]({{ url }}#wait-for-data-to-become-available) + - [Signal that data is available]({{ url }}#signal-that-data-is-available) + - [Register a callback handler]({{ url }}#register-a-callback-handler) + - [Specify dataport interfaces]({{ url }}#specify-dataport-interfaces) + - [Specify dataport connections]({{ url }}#specify-dataport-connections) + - [Copy strings to an untyped dataport]({{ url }}#copy-strings-to-an-untyped-dataport) + - [Read the reply data from a typed dataport]({{ url }}#read-the-reply-data-from-a-typed-dataport) + - [Send data using dataports]({{ url }}#send-data-using-dataports) + - [Read data from an untyped dataport]({{ url }}#read-data-from-an-untyped-dataport) + - [Put data into a typed dataport]({{ url }}#put-data-into-a-typed-dataport) + - [Read data from a typed dataport]({{ url }}#read-data-from-a-typed-dataport) + - [Set component priorities]({{ url }}#set-component-priorities) + - [Restrict access to dataports]({{ url }}#restrict-access-to-dataports) + - [Test the read and write permissions on the dataport]({{ url }}#test-the-read-and-write-permissions-on-the-dataport) + +{% assign url = "hello-camkes-timer?tut_expand" %} +### [CAmkES Timer]({{ url }}) + - [Instantiate a Timer and Timerbase]({{ url }}#instantiate-a-timer-and-timerbase) + - [Connect a timer driver component]({{ url }}#connect-a-timer-driver-component) + - [Configure a timer hardware component instance]({{ url }}#configure-a-timer-hardware-component-instance) + - [Call into a supplied driver to handle the interrupt]({{ url }}#call-into-a-supplied-driver-to-handle-the-interrupt) + - [Stop a timer]({{ url }}#stop-a-timer) + - [Acknowledge an interrupt]({{ url }}#acknowledge-an-interrupt) + - [Get a timer handler]({{ url }}#get-a-timer-handler) + - [Start a timer]({{ url }}#start-a-timer) + - [Implement an RPC interface]({{ url }}#implement-a-rpc-interface) + - [Set a timer interrupt]({{ url }}#set-a-timer-interrupt) + - [Instantiate a TimerDTB component]({{ url }}#instantiate-a-timerdtb-component) + - [Connect interfaces using the seL4DTBHardware connector]({{ url }}#connect-interfaces-using-the-sel4dtbhardware-connector) + - [Configure the TimerDTB component]({{ url }}#configure-the-timerdtb-component) + - [Handle the interrupt]({{ url }}#handle-the-interrupt) + - [Stop the timer]({{ url }}#stop-the-timer) + +{% assign url = "camkes-vm-linux?tut_expand" %} +### [CAmkES VM Linux]({{ url }}) + - [Add a program]({{ url }}#adding-a-program) + - [Add a kernel module]({{ url }}#adding-a-kernel-module) + - [Create a hypercall]({{ url }}#creating-a-hypercall) + +{% assign url = "camkes-vm-crossvm?tut_expand" %} +### [CAmkeES Cross VM Connectors]({{ url }}) + - [Add modules to the guest]({{ url }}#add-modules-to-the-guest) + - [Define interfaces in the VMM]({{ url }}#define-interfaces-in-the-vmm) + - [Define the component interface]({{ url }}#define-the-component-interface) + - [Instantiate the print server]({{ url }}#instantiate-the-print-server) + - [Implement the print server]({{ url }}#implement-the-print-server) + - [Implement the VMM side of the connection]({{ url }}#implement-the-vmm-side-of-the-connection) + - [Update the build system]({{ url }}#update-the-build-system) + - [Add interfaces to the Guest]({{ url }}#add-interfaces-to-the-guest) + - [Create a process]({{ url }}#create-a-process) \ No newline at end of file diff --git a/Tutorials/index.md b/Tutorials/index.md index d8c2c60cf6..594fd5fbd7 100644 --- a/Tutorials/index.md +++ b/Tutorials/index.md @@ -1,27 +1,30 @@ --- toc: true -redirect_from: - - /projects/sel4-tutorials.html - - /projects/sel4-tutorials/ -layout: project -project: sel4-tutorials +title: Tutorials +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- +# Overview -# Tutorials +We have developed a series of tutorials to introduce seL4 and developing systems on seL4. -{% assign tutorials = site.pages | where_exp: 'page', 'page.tutorial' | sort: 'tutorial-order' %} +## List of tutorials +The tutorials are split into a number of broad categories, and have been designed around developer needs. + +- The [seL4 tutorials](setting-up.md) are for people keen to learn about the base mechanisms provided by the seL4 kernel. The kernel API is explained with short exercises that show basic examples. + +- [MCS](mcs) introduces seL4 Mixed-Criticality System extensions, which are detailed in this [paper](https://trustworthy.systems/publications/full_text/Lyons_MAH_18.pdf) and [PhD](https://github.com/pingerino/phd/blob/master/phd.pdf). + +- [Libraries](libraries-1) provides walkthroughs and exercises for using the libraries provided in `seL4_libs`, which were developed for rapidly prototyping systems on seL4. + +- [CAmkES](hello-camkes-0) generates the glue code for interacting with seL4 and is designed for building high-assurance, static systems. These tutorials demonstrate how to configure static systems through components. -We have developed a series of tutorials to introduce seL4 and -developing systems on seL4. +- [Microkit](https://trustworthy.systems/projects/microkit/tutorial/) enables system designers to create static software systems based on the seL4 microkernel. We recommend this as a potential introduction to seL4, bearing in mind that the Microkit hides many of the seL4 mechanisms - it is designed that way, to make building on top of seL4 easier. -## How to use the tutorials +- [Rust](https://github.com/seL4/rust-sel4) allows people to write safer user-level code on top of seL4 without needing full formal verification, with a language that is receiving increasing interest and that aligns extremely well with security and safety critical embedded systems programming. -Depending on your goals and what you want to do with seL4, we suggest -different paths to follow through the tutorial material. Choose the -most relevant category below and follow the tutorials in the suggested -order. +**Recommended reading** Note that all of these tutorials require C programming experience and some understanding of operating systems and computer @@ -32,222 +35,17 @@ architecture. Suggested resources for these include: - Operating Systems: - [Modern Operating Systems (book)](https://www.amazon.com/Modern-Operating-Systems-Andrew-Tanenbaum/dp/013359162X) - [COMP3231 at UNSW](http://www.cse.unsw.edu.au/~cs3231) -- Computer Architecture - - [Computer Architecture (wikipedia)](https://en.wikipedia.org/wiki/Computer_architecture) - - [Instruction Set Architecture (wikipedia)](https://en.wikipedia.org/wiki/Instruction_set_architecture) - -### Evaluation - -Goal: - -- You want to understand what seL4 is and what benefits it gives. -- You want to understand how seL4 can be used to develop trustworthy systems. -- You want to get your hands a little dirty and see, compile, and run some code. - -Follow these tutorials: - -1. [seL4 overview](https://sel4.systems/About/seL4-whitepaper.pdf) -2. [Introduction tutorial](#introduction-tutorial) - -### System Building - -Goal: - -- You want to build systems based on seL4. -- You want to know what tools are available to do so and how to use those tools. -- You want experience with how to use seL4 and the tools to build trustworthy systems. - -Follow these tutorials: - -1. [seL4 overview](https://sel4.systems/About/seL4-whitepaper.pdf) -2. [Introduction tutorial](#introduction-tutorial) -3. [CAmkES tutorials](#camkes-tutorials) -4. [Virtualisation tutorials](#virtual-machines) -5. [MCS tutorial](#mcs-extensions) - -### Platform Development - -Goal: - -- You want to contribute to development of the seL4 (user-level) platform. -- You want to develop operating system services and device drivers. -- You want to develop seL4-based frameworks and operating systems. - -Follow these tutorials: - -1. [seL4 overview](https://sel4.systems/About/seL4-whitepaper.pdf) -2. [Introduction tutorial](#introduction-tutorial) -3. [seL4 mechanisms tutorial](#seL4-mechanisms-tutorials) -4. [Rapid prototyping tutorials](#rapid-prototyping-tutorials) -5. [CAmkES tutorials](#camkes-tutorials) -6. [Virtualisation tutorial](#virtual-machines) -7. [MCS tutorial](#mcs-extensions) - - -### Kernel Development - -Goal: - -- You want to contribute to the seL4 kernel itself. -- You want to port seL4 to a new platform. -- You want to add new features to the kernel. - -Read this first: - -- [Contributing to kernel code](/projects/sel4/kernel-contribution.html) - -Then follow these tutorials: - -1. [seL4 overview](https://sel4.systems/About/seL4-whitepaper.pdf) -2. [Introduction tutorial](#introduction-tutorial) -3. [seL4 mechanisms tutorial](#seL4-mechanisms-tutorials) -4. [MCS tutorial](#mcs-extensions) - -# The Tutorials - -## Prerequisites - -* [set up your machine](/GettingStarted#setting-up-your-machine). - -### Python Dependencies -Additional python dependencies are required to build tutorials. To install you can run: -``` -pip install --user aenum -pip install --user pyelftools -``` - -### Get the code -``` -mkdir sel4-tutorials-manifest -cd sel4-tutorials-manifest -repo init -u https://github.com/seL4/sel4-tutorials-manifest -repo sync -``` - -### Doing the tutorials - -The top of the source tree contains the kernel itself, and the tutorials are found in the subfolder: "`projects/sel4-tutorials`". The tutorial consists of some pre-written sample applications which have been deliberately half-written. You will be guided through filling in the missing portions, and thereby become acquainted with seL4. For each of the sample applications however, there is a completed solution that shows all the correct answers, as a reference. -When completing the tutorials you will be initialising and building your solutions with CMake. The general flow of completing a tutorial exercise involves: -``` -# creating a Tutorial directory -mkdir tutorial -cd tutorial -# initialising the build directory with a tutorial exercise -../init --plat --tut -# building the tutorial exercise -ninja -``` - -After initialising your directory you will be setup with half-written source for you to complete. Additinally, a build -directory will be created based on your directory name eg `tutorial_build`. - -Your job is to follow the tutorial instructions to complete the application in the tutorial folder. - -- The completed sample applications showing the solutions to the - tutorial challenges can be retrieved by initialsing a directory with the `--solution` argument - e.g. `../init --plat --tut --solution` - -## List of tutorials - -### Introduction tutorial - -Before starting tutorials, make sure that you have read through the -[Prerequisites](#prerequisites) and in particular [Doing the -tutorials](#doing-the-tutorials). - -Then, before any other tutorial, do the hello-world tutorial: - -{%- for t in tutorials %} -{%- if t.tutorial-order contains '0-hello' %} -1. [{{t.title}}]({{t.url}}) {{t.description}} -{%- endif %} -{%- endfor %} - -which will ensure your setup is working correctly. - -### seL4 mechanisms tutorials - -This set of tutorials are for people keen to learn about the base mechanisms provided -by the seL4 kernel. You will learn about the kernel API through small exercises -that show basic examples. - -{% assign tutorials = site.pages | where_exp: 'page', 'page.tutorial' | sort: 'tutorial-order' %} -{%- for t in tutorials %} -{%- if t.tutorial-order contains 'mechanisms' %} -1. [{{t.title}}]({{t.url}}) {{t.description}} -{%- endif %} -{%- endfor %} - -### Rapid prototyping tutorials - -This set of tutorials provides walkthroughs and exercises for using the dynamic -libraries provided in [seL4_libs](TODO LINK). These libraries are provided as is, -and have been developed for rapidly prototyping systems on seL4. They have not been -through intensive quality assurance and do have bugs. Contributions are welcome. - -{%- for t in tutorials %} -{%- if t.tutorial-order contains 'dynamic' %} -1. [{{t.title}}]({{t.url}}) {{t.description}} -{%- endif %} -{%- endfor %} - -* The slide presentations to guide you through the tutorials are in the following files: - - - `projects/sel4-tutorials/docs/seL4-Overview.pdf`: This - is an overview of the design and thoughts behind seL4, and - we strongly recommend you read it before starting - the tutorials. - - `projects/sel4-tutorials/docs/seL4-APILib-details.pdf`: This is the actual tutorial. - -### CAmkES tutorials - -These tutorials get you started with our component system CAmkES, which -allows you to configure static systems through components. CAmkES -generates the glue code for interacting with seL4 and is designed for building -high-assurance, static systems. - -These tutorials work similarly to the SEL4 tutorials in that they are -guided by a slide presentation. There are half-completed sample -applications, with a set of slides giving instructions, with TASK -challenges once again. There are also completed sample solutions. - -{%- for t in tutorials %} -{%- if t.tutorial-order contains 'camkes' %} -1. [{{t.title}}]({{t.url}}) {{t.description}} -{%- endif %} -{%- endfor %} - -- The slide presentations to guide you through the tutorials are - in this - file: `projects/sel4-tutorials/docs/CAmkESTutorial.pdf`. - -### Virtual machines - -These tutorials show how to run Linux guests on Camkes and how to communicate between them. -Currently these tutorials are for x86 only. - -{%- for t in tutorials %} -{%- if t.tutorial-order contains 'vm' %} -1. [{{t.title}}]({{t.url}}) {{t.description}} -{%- endif %} -{%- endfor %} - -### MCS extensions - -The MCS extensions are upcoming API changes to seL4. - -{%- for t in tutorials %} -{%- if t.tutorial-order contains 'mcs' %} -1. [{{t.title}}]({{t.url}}) {{t.description}} -{%- endif %} -{%- endfor %} - -## What next? - -You can try building and running [seL4test](../seL4Test). -Next steps include working on one of our [suggested -projects](/SuggestedProjects.html) or helping to expand the collection -of [libraries and -components](/projects/available-user-components.html) available to -build seL4-based systems. +## Resources +Additional resources to assist with learning: +- The [seL4 manual](https://sel4.systems/Info/Docs/seL4-manual-latest.pdf) +- [API references](../../projects/sel4/api-doc) +- The [How to](how-to) page provides links to tutorial solutions as quick references for seL4 calls and methods. +- The [seL4 white paper](https://sel4.systems/About/seL4-whitepaper.pdf) +- [FAQs](../../projects/sel4/frequently-asked-questions) +- [Debugging guide](../../projects/sel4-tutorials/debugging-guide) +- [Contact](../../Resources#contact) + +

+ Next: Pathways through the tutorials +

\ No newline at end of file diff --git a/Tutorials/interrupts.md b/Tutorials/interrupts.md index ffeb05c281..e97240d93e 100644 --- a/Tutorials/interrupts.md +++ b/Tutorials/interrupts.md @@ -2,10 +2,8 @@ toc: true title: Interrupts tutorial: interrupts -tutorial-order: mechanisms-7 -description: receiving and handling interrupts. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/ipc.md b/Tutorials/ipc.md index a7e313dc2c..77e6742240 100644 --- a/Tutorials/ipc.md +++ b/Tutorials/ipc.md @@ -2,8 +2,7 @@ toc: true title: IPC tutorial: ipc -tutorial-order: mechanisms-5 -description: overview of interprocess communication (IPC). +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- diff --git a/Tutorials/dynamic-2.md b/Tutorials/libraries-1.md similarity index 59% rename from Tutorials/dynamic-2.md rename to Tutorials/libraries-1.md index 0795b76fa9..f16348251b 100644 --- a/Tutorials/dynamic-2.md +++ b/Tutorials/libraries-1.md @@ -1,11 +1,9 @@ --- toc: true -title: Dynamic Libraries 2 -tutorial: dynamic-2 -tutorial-order: dynamic-2 -description: IPC with seL4_libs. +title: Libraries initialisation & threading +tutorial: libraries-1 +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/dynamic-3.md b/Tutorials/libraries-2.md similarity index 55% rename from Tutorials/dynamic-3.md rename to Tutorials/libraries-2.md index 2c38d921a1..21464a7344 100644 --- a/Tutorials/dynamic-3.md +++ b/Tutorials/libraries-2.md @@ -1,11 +1,9 @@ --- toc: true -title: Dynamic Libraries 3 -tutorial: dynamic-3 -tutorial-order: dynamic-3 -description: process management with seL4_libs. +title: Libraries IPC +tutorial: libraries-2 +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/dynamic-4.md b/Tutorials/libraries-3.md similarity index 55% rename from Tutorials/dynamic-4.md rename to Tutorials/libraries-3.md index e66a050f9f..0ca7e76a4d 100644 --- a/Tutorials/dynamic-4.md +++ b/Tutorials/libraries-3.md @@ -1,11 +1,9 @@ --- toc: true -title: Dynamic Libraries 4 -tutorial: dynamic-4 -tutorial-order: dynamic-4 -description: timers and timeouts with seL4_libs. +title: Libraries processes & ELF loading +tutorial: libraries-3 +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/dynamic-1.md b/Tutorials/libraries-4.md similarity index 52% rename from Tutorials/dynamic-1.md rename to Tutorials/libraries-4.md index 091b71918f..7fe099cb2e 100644 --- a/Tutorials/dynamic-1.md +++ b/Tutorials/libraries-4.md @@ -1,11 +1,9 @@ --- toc: true -title: Dynamic Libraries 1 -tutorial: dynamic-1 -tutorial-order: dynamic-1 -description: system initialisation & threading with seL4_libs. +title: Libraries timer tutorial +tutorial: libraries-4 +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/mapping.md b/Tutorials/mapping.md index b3c5136bc7..b931d9732c 100644 --- a/Tutorials/mapping.md +++ b/Tutorials/mapping.md @@ -2,8 +2,7 @@ toc: true title: Mapping tutorial: mapping -tutorial-order: mechanisms-3 -description: virtual memory in seL4. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- diff --git a/Tutorials/mcs.md b/Tutorials/mcs.md index 64ba2f8382..fac1ee019d 100644 --- a/Tutorials/mcs.md +++ b/Tutorials/mcs.md @@ -2,10 +2,8 @@ toc: true title: MCS tutorial: mcs -tutorial-order: mcs-1 -description: an introduction to the seL4 MCS extensions. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/notifications.md b/Tutorials/notifications.md index f4227272cd..f92ec784b3 100644 --- a/Tutorials/notifications.md +++ b/Tutorials/notifications.md @@ -2,10 +2,8 @@ toc: true title: Notifications tutorial: notifications -tutorial-order: mechanisms-6 -description: using notification objects and signals. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- {% include tutorial.md %} - diff --git a/Tutorials/pathways.md b/Tutorials/pathways.md new file mode 100644 index 0000000000..46bf7b9023 --- /dev/null +++ b/Tutorials/pathways.md @@ -0,0 +1,63 @@ +--- +toc: true +title: Pathways +layout: tutorial +SPDX-License-Identifier: CC-BY-SA-4.0 +SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. +--- + +# Pathways through tutorials +The tutorials can be approached in a number of different ways. Our recommended approach for newcomers is to begin the [Microkit](https://trustworthy.systems/projects/microkit/tutorial/), bearing in mind that the Microkit hides many of the seL4 mechanisms - it is designed that way, to make building on top of seL4 easier. Having built a small system on top of seL4, the developer can delve into the concepts in the order list in the navigation bar to the left. + +## Alternate pathways +Alternate pathways through the tutorials depend on development goals. + +### Evaluation +Goals +- to understand seL4 and its benefits +- to learn how to use seL4 to develop trustworthy systems +- to see, compile, and run some code + +Recommended tutorials +- [Setting up your machine](setting-up.md) +- [Getting the tutorials](get-the-tutorials.md) +- [Hello world](hello-world.md) + +### System Building +Goals +- to build systems based on seL4 +- to know which tools are available to build systems, and how to use those tools +- to build trustworthy systems + +Recommended tutorials +- [Setting up your machine](setting-up.md) +- [Getting the tutorials](get-the-tutorials.md) +- [Hello world](hello-world.md) +- [MCS](mcs.md) +- The CAmkES tutorials beginning with [Hello CAmkES](hello-camkes-0.md) +- Virtualisation tutorials + - [CAmkES VM](../CAmkES/camkes-vm-linux) using Linux as a guest in the CAmkES VM; and + - [CAmkES Cross-VM communication](camkes-vm-crossvm.md) walkthrough of adding communication between Linux guests in separate VMs + + +### Platform Development +Goals +- to contribute to development of the seL4 (user-level) platform +- to develop operating system services and device drivers +- to develop seL4-based frameworks and operating systems + +Recommended tutorials +To gain a comprehensive understanding of seL4, we recommend that you go through all the tutorials in the order listed in the default pathway. + + +### Kernel Development +Goals +- to contribute to the seL4 kernel itself +- to port seL4 to a new platform +- to add new features to the kernel + +Recommended reading +- [Contributing to kernel code](../../projects/sel4/kernel-contribution) + +Recommended tutorials +- Follow the tutorial in the default pathway up to and including MCS. diff --git a/Tutorials/setting-up.md b/Tutorials/setting-up.md new file mode 100644 index 0000000000..1332e61164 --- /dev/null +++ b/Tutorials/setting-up.md @@ -0,0 +1,154 @@ +--- +toc: true +layout: tutorial +SPDX-License-Identifier: CC-BY-SA-4.0 +SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. +--- + +# Setting up your machine + +## 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 +``` + +
+More on Repo +
+[More details about on installing Repo](https://source.android.com/setup/develop#installing-repo). + +[seL4 Repo cheatsheet](../projects/buildsystem/repo-cheatsheet) +
+ +## Docker +To compile and use seL4, it is recommended that you use Docker to isolate the dependencies from your machine. + +These instructions assume you are using Debian (or a derivative, such as Ubuntu), and are using Bash for your shell. However, it should be informative enough for users of other distros/shells to adapt. + +These instructions are intended for Ubuntu LTS versions 20.04 and 22.04. + +To begin, you will need at least these two programs: + + * make (`sudo apt install make`) + * docker (See [here](https://get.docker.com) or [here](https://docs.docker.com/engine/installation) for installation instructions) + +For convenience, add your account to the docker group: + +```bash +sudo usermod -aG docker $(whoami) +``` + +
+ More on Docker +
+ + **Available images** + + All the prebuilt docker images are available on [DockerHub here](https://hub.docker.com/u/trustworthysystems) + + These images are used by the Trustworthy Systems Continuous Integration (CI) software, and so represent a standard software setup we use. + The CI software always uses the `latest` docker image, but images are also tagged with the date they were built. + + **More information** + + You can find the dockerfiles and supporting Makefile [here](https://github.com/seL4/seL4-CAmkES-L4v-dockerfiles) + +
+ + +### 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 +cd seL4-CAmkES-L4v-dockerfiles +make user +``` + +This will give you a terminal inside a container that has all the relevant tools to build, simulate, and test seL4 & Camkes programs. + +The first time you run this, docker will fetch the relevant images, which may take a while. + +The last line will say something like: + +``` +Hello, welcome to the seL4/CAmkES/L4v docker build environment +``` + +### Mapping a container +To run the container from other directories (e.g. starting a container for the [Hello World](hello-world.md) tutorial, which we'll do next), you can setup a bash alias such as this: + +```bash +echo $'alias container=\'make -C ///seL4-CAmkES-L4v-dockerfiles user HOST_DIR=$(pwd)\'' >> ~/.bashrc +# now open a new terminal, or run `source ~/.bashrc` +``` + +Replace `///` to match where you cloned the git repo of the docker files. + +*Reminder:* Include the absolute path to your `seL4-CAmkES-L4v-dockerfiles` folder, e.g. + +```bash +echo $'alias container=\'make -C /~/seL4-CAmkES-L4v-dockerfiles user HOST_DIR=$(pwd)\'' >> ~/.bashrc +# now open a new terminal, or run `source ~/.bashrc` + +``` + +This then allows you to run `container` from any directory. + +*Reminder:* start a new terminal for the changes in `.bashrc` to take effect or run `source ~/.bashrc`. + + +## An example workflow + +A good workflow is to run two terminals: + + - Terminal A is just a normal terminal, and is used for git operations, editing (e.g., vim, emacs, vscode), and other non-build operations. + - Terminal B is running in a container, and is only used for compilation. + +This gives you the flexibility to use all the normal tools you are used to, while having the seL4 dependencies separated from your machine. + +### Compiling seL4 test + +Start two terminals (terminal A and terminal B). + +In terminal A, run these commands: + +```bash +jblogs@host:~$ mkdir ~/seL4test +jblogs@host:~$ cd ~/seL4test +jblogs@host:~/seL4test$ repo init -u https://github.com/seL4/seL4test-manifest.git +jblogs@host:~/seL4test$ repo sync +``` + +In terminal B, run these commands: + +```bash +jblogs@host:~$ cd ~/seL4test +jblogs@host:~/seL4test$ container # using the bash alias defined above +jblogs@in-container:/host$ mkdir build-x86 +jblogs@in-container:/host$ cd build-x86 +jblogs@in-container:/host/build-x86$ ../init-build.sh -DPLATFORM=x86_64 -DSIMULATION=TRUE +jblogs@in-container:/host/build-x86$ ninja +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` 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. +All is well in the universe +``` + +Note, if QEMU fails when trying to simulate the image, try configuring your Docker host to give the container more memory using [Docker Desktop](https://docs.docker.com/desktop/use-desktop/). + +That's it! seL4 is running. + +To quit QEMU: `Ctrl+a, x` + diff --git a/Tutorials/threads.md b/Tutorials/threads.md index 99cadd657c..7a1d2f1d8d 100644 --- a/Tutorials/threads.md +++ b/Tutorials/threads.md @@ -2,8 +2,7 @@ toc: true title: Threads tutorial: threads -tutorial-order: mechanisms-4 -description: how to start a thread using the seL4 API. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- diff --git a/Tutorials/untyped.md b/Tutorials/untyped.md index 17c1ab3b48..5948a7a492 100644 --- a/Tutorials/untyped.md +++ b/Tutorials/untyped.md @@ -2,8 +2,7 @@ toc: true title: Untyped tutorial: untyped -tutorial-order: mechanisms-2 -description: user-level memory management. +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- diff --git a/_data/projects/sel4-tutorials.yml b/_data/projects/sel4-tutorials.yml index a091a4acad..ee35aa28c4 100644 --- a/_data/projects/sel4-tutorials.yml +++ b/_data/projects/sel4-tutorials.yml @@ -12,6 +12,10 @@ repositories: - org: sel4proj repo: sel4-tutorials-manifest +# The order of the components list determines the order of the tutorials in the +# tutorial nav side bar. The field section is used there to include groups of +# tutorials. + components: - name: hello-world display_name: "Hello world" @@ -19,120 +23,160 @@ components: maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: hello-camkes-0 - display_name: "CAmkES" - description: "The first CAmkES application to run" + section: sel4 + + - name: capabilities + display_name: "Capabilities" + description: "seL4 capabilities tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: hello-camkes-1 - display_name: "CAmkES 1" - description: "CAmkES ADL and RPC interface tutorial" + section: sel4 + + - name: untyped + display_name: "Untyped" + description: "Physical memory management tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: hello-camkes-2 - display_name: "CAmkES 2" - description: "CAmkES event and dataport tutorial" + section: sel4 + + - name: mapping + display_name: "Mapping" + description: "Virtual memory management tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: hello-camkes-timer - display_name: "CAmkES timer" - description: "CAmkES tutorial for accessing hardware" + section: sel4 + + - name: threads + display_name: "Threads" + description: "Threads on seL4 tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: dynamic-1 - display_name: "Dynamic Libraries 1" - description: "Initialisation and threading tutorial" + section: sel4 + + - name: ipc + display_name: "IPC" + description: "seL4 IPC tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: dynamic-2 - display_name: "Dynamic Libraries 2" - description: "seL4 IPC and userspace paging management tutorial" + section: sel4 + + - name: notifications + display_name: "Notification" + description: "seL4 notification tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: dynamic-3 - display_name: "Dynamic Libraries 3" - description: "Processes and ELF loading tutorial" + section: sel4 + + - name: interrupts + display_name: "Interrupts" + description: "Tutorial for accessing interrupts on seL4" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: dynamic-4 - display_name: "Dynamic Libraries 4" - description: "Tutorial for using device drivers" + section: sel4 + + - name: fault-handlers + display_name: "Fault handling" + description: "Fault handling tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application + section: sel4 + - name: mcs - display_name: "MCS" + display_name: "MCS extensions" description: "MCS extension tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: capabilities - display_name: "Capabilities" - description: "seL4 capabilities tutorial" + section: sel4 + + - name: libraries-1 + display_name: "Initialisation & threading" + description: "Initialisation and threading tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: untyped - display_name: "Untyped" - description: "Physical memory management tutorial" + section: libraries + + - name: libraries-2 + display_name: "IPC" + description: "seL4 IPC and userspace paging management tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: mapping - display_name: "Mapping" - description: "Virtual memory management tutorial" + section: libraries + + - name: libraries-3 + display_name: "Processes & Elf loading" + description: "Processes and ELF loading tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: threads - display_name: "Threads" - description: "Threads on seL4 tutorial" + section: libraries + + - name: libraries-4 + display_name: "Timer" + description: "Tutorial for using device drivers" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: ipc - display_name: "IPC" - description: "seL4 IPC tutorial" + section: libraries + + - name: hello-camkes-0 + display_name: "Hello CAmkES" + description: "The first CAmkES application to run" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: notifications - display_name: "Notification" - description: "seL4 notification tutorial" + section: camkes + + - name: hello-camkes-1 + display_name: "Introduction to CAmkES" + description: "CAmkES ADL and RPC interface tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: interrupts - display_name: "Interrupts" - description: "Tutorial for accessing interrupts on seL4" + section: camkes + + - name: hello-camkes-2 + display_name: "Events in CAmkES" + description: "CAmkES event and dataport tutorial" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application - - name: fault-handlers - display_name: "Fault handling" - description: "Fault handling tutorial" + section: camkes + + - name: hello-camkes-timer + display_name: "CAmkES timer tutorial" + description: "CAmkES tutorial for accessing hardware" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application + section: camkes + - name: camkes-vm-linux - display_name: "CAmkES VM Linux" + display_name: "CAmkES VM" description: "Tutorial for creating VM guests and applications on seL4 using CAmkES" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application + section: camkes + - name: camkes-vm-crossvm - display_name: "CAmkES cross-VM communication" - description: "Tutorial for using cross virtual machine connector" + display_name: "CAmkES cross-VM connectors" + description: "Tutorial for using cross virtual machine connectors" maintainer: "seL4 Foundation" status: "active" component_type: sel4-tutorials-application + section: camkes + - name: libsel4tutorials display_name: "libsel4tutorials" description: "Utility Library for doing seL4 tutorials" diff --git a/_data/sidebar.yml b/_data/sidebar.yml index 398790862c..716b413a53 100644 --- a/_data/sidebar.yml +++ b/_data/sidebar.yml @@ -2,11 +2,11 @@ # Copyright 2020 seL4 Project a Series of LF Projects, LLC. toc: - - title: Getting Started - url: /GettingStarted.html + - title: Resources + url: /Resources.html subfolderitems: - - page: Getting Started - url: /GettingStarted.html + - page: Resources + url: /Resources.html - page: seL4 Documentation url: /projects/sel4/documentation.html - page: seL4 FAQ diff --git a/_data/tutorials-sidebar.yml b/_data/tutorials-sidebar.yml new file mode 100644 index 0000000000..50918a4050 --- /dev/null +++ b/_data/tutorials-sidebar.yml @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: CC-BY-SA-4.0 +# Copyright 2024 seL4 Project a Series of LF Projects, LLC. + +# nav side bar for tutorials +# +# refers to sections from projects/sel4-tutorials.yml via the "section" field +# there, and "include" field here. + +- name: Getting started + type: header +- name: Overview + file: "" + type: file +- name: Tutorial pathways + file: pathways + type: file + +- name: seL4 + type: header +- name: Setting up your machine + file: setting-up + type: file +- name: Getting the tutorials + file: get-the-tutorials + type: file +- name: sel4 + type: include + +- name: C Libraries + type: header +- name: libraries + type: include + +- name: Microkit + type: header +- name: Tutorial + url: https://trustworthy.systems/projects/microkit/tutorial/ + type: url + +- name: CAmkES + type: header +- name: camkes + type: include + +- name: Rust + type: header +- name: GitHub + url: https://github.com/seL4/rust-sel4 + type: url + +- name: Resources + type: header +- name: seL4 Manual + url: https://sel4.systems/Info/Docs/seL4-manual-latest.pdf + type: url +- name: seL4 API reference + url: /projects/sel4/api-doc.html + type: url +- name: "How to: a quick solutions guide" + file: how-to + type: file +- name: Debugging guide + url: /projects/sel4-tutorials/debugging-guide + type: url +- name: Help contacts + url: "/Resources#contact" + type: url diff --git a/_includes/header.html b/_includes/header.html index 7ad4305701..f8d2186f76 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -16,10 +16,10 @@ diff --git a/_includes/nav-sidebar.html b/_includes/nav-sidebar.html index ec2e59d4a3..5de88be0e4 100644 --- a/_includes/nav-sidebar.html +++ b/_includes/nav-sidebar.html @@ -11,7 +11,7 @@ {% endif %} - -{% if page_url[1] == "Tutorials" %} - -{% endif %} - + \ No newline at end of file diff --git a/_includes/tutorial.md b/_includes/tutorial.md index 3c64986ba7..d654e3bffa 100644 --- a/_includes/tutorial.md +++ b/_includes/tutorial.md @@ -3,15 +3,4 @@ SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. {% endcomment %} -{% capture path %} -{{page.tutorial}}/{{page.tutorial}}.md -{% endcapture %} - -{% assign view_url = 'https://github.com/sel4/' | append: "sel4-tutorials" | append: '/blob/master/tutorials/' | append: path %} -{% assign edit_url = 'https://github.com/sel4/' | append: "sel4-tutorials" | append: '/edit/master/tutorials/' | append: path %} - {% include_absolute _repos/tutes/{{page.tutorial}}.md %} - -------------- - -*Tutorial included from [github repo]({{view_url}}) [edit]({{edit_url}})* diff --git a/_includes/tutorials-sidebar.html b/_includes/tutorials-sidebar.html new file mode 100644 index 0000000000..73604debdc --- /dev/null +++ b/_includes/tutorials-sidebar.html @@ -0,0 +1,23 @@ +{% comment %} +SPDX-License-Identifier: CC-BY-SA-4.0 +SPDX-FileCopyrightText: 2024 seL4 Project a Series of LF Projects, LLC. +{% endcomment %} + + diff --git a/_layouts/overview.html b/_layouts/overview.html new file mode 100644 index 0000000000..50a4f2d197 --- /dev/null +++ b/_layouts/overview.html @@ -0,0 +1,28 @@ +--- +layout: basic +SPDX-License-Identifier: CC-BY-SA-4.0 +SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. +--- + +
+ +
+ {{ content }} +
+ +{% assign url = page.url | split: "/" %} +{% capture project_name %} +{% if page.project %} +{{page.project}} +{% elsif url[1] == "projects" %} +{{url[2]}} +{% endif %} +{% endcapture %} + +{% assign project_name = project_name | strip %} +{% assign project = site.data.projects[project_name] %} + +
diff --git a/_layouts/tutorial.html b/_layouts/tutorial.html new file mode 100644 index 0000000000..10fec7164e --- /dev/null +++ b/_layouts/tutorial.html @@ -0,0 +1,86 @@ +--- +layout: basic +SPDX-License-Identifier: CC-BY-SA-4.0 +SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. +--- + +{%- assign components = site.data.projects["sel4-tutorials"].components -%} +{%- assign all_tutes = "" | split: "." -%} +{%- for item in site.data.tutorials-sidebar -%} +{%- if item.type == "include" -%} +{%- for component in components -%} +{%- if component.section == item.name -%} +{%- assign all_tutes = all_tutes | push: component -%} +{%- endif -%} +{%- endfor -%} +{%- else -%} +{%- assign all_tutes = all_tutes | push: item -%} +{%- endif -%} +{%- endfor -%} + +
+ +
+ + {{ content }} + +

+{% assign page_file = page.url | split: '/' | last | remove: ".html" -%} +{%- assign found = false -%} +{%- for item in all_tutes -%} +{%- if found -%} +{%- if item.type == "header" -%} +{%- comment -%} + We include the preceding header name in the "next" link when the link + is an offsite URL, e.g. for Microkit or Rust. +{%- endcomment -%} +{%- assign header_name = item.name -%} +{%- else -%} +{%- case item.type -%} +{%- when "file" -%} +{%- assign url = "/Tutorials/" | append: item.file | relative_url %} + Next: {{ item.name }} +{%- when "url" -%} +{%- else -%} +{%- assign url = "/Tutorials/" | append: item.name | relative_url %} + Next: {{ item.display_name }} +{%- endcase -%} +{%- break -%} +{%- endif -%} +{%- else -%} +{%- case item.type -%} +{%- when "file" -%} +{%- if item.file == page_file -%} +{%- assign found = true -%} +{%- endif -%} +{%- when "url" -%} +{%- when "header" -%} +{%- else -%} +{%- if item.name == page_file -%} +{%- assign found = true -%} +{%- endif -%} +{%- endcase -%} +{%- endif -%} +{%- endfor %} +

+ +{% if page.tutorial -%} + {%- capture path -%} + {{page.tutorial}}/{{page.tutorial}}.md + {%- endcapture -%} + + {%- assign repo_url = 'https://github.com/sel4/sel4-tutorials' -%} + {%- assign view_url = repo_url | append: '/blob/master/tutorials/' | append: path -%} + {%- assign edit_url = repo_url | append: '/edit/master/tutorials/' | append: path -%} +
+

Tutorial included from github repo edit

+{%- endif %} +
+ + {% if page.toc %} + {% include toc-sidebar.html %} + {% endif %} +
+ diff --git a/assets/css/style.scss b/assets/css/style.scss index 7e224e395c..85a44ffb94 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -252,6 +252,20 @@ h2 a, background-color: #428bca; } +.tutorial-sidebar li { + padding-bottom: 0; + padding-top: 0; +} +.tutorial-sidebar li > a { + padding-bottom: 0.5ex; + padding-top: 0.5ex; +} + +li.nav-section { + padding-top: 1ex; + font-weight: bold; +} + /* This adds a unicode character corresponding to .fa-external-link-alt from fontawesome to every external link */ a[href*="//"]:not([href*="{{site.url}}"],.skip-icon):after { @@ -291,3 +305,14 @@ a[href*="//"]:not([href*="{{site.url}}"],.skip-icon):after { .flex-grid-thirds .col { width: 32%; } + +/* tutorials solutions boxes */ +details { + padding-bottom: 20px; +} +summary { + display:list-item; +} +details > summary { + cursor: pointer; +} diff --git a/assets/js/toggle-markdown.js b/assets/js/toggle-markdown.js new file mode 100644 index 0000000000..8e45bd629a --- /dev/null +++ b/assets/js/toggle-markdown.js @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// Copyright 2024 seL4 Project a Series of LF Projects, LLC. + +// Expand all solutions +let param = new URLSearchParams(window.location.search); + +if (param.has('tut_expand')) { + document.body.querySelectorAll('details').forEach((e) => { + e.setAttribute('open', true); + }) +} diff --git a/content_collections/_updates/sel4-tutorials/camkes-3.8.x.md b/content_collections/_updates/sel4-tutorials/camkes-3.8.x.md index 388f3b6572..719f5e25cf 100644 --- a/content_collections/_updates/sel4-tutorials/camkes-3.8.x.md +++ b/content_collections/_updates/sel4-tutorials/camkes-3.8.x.md @@ -16,7 +16,7 @@ SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. - `interrupts`: Remove sample output that doesn't appear in practice. - `hello-camkes-2`: Update exit text test to match actual output. - `mcs`: reduce spinner budget for final task to ensure timeout behavior happens correctly. -- `dynamic-4`: Correctly initalize a stack variable. +- `libraries-4`: Correctly initalize a stack variable. - `hello-camkes-timer`: Use device tree for binding timer component to device and update tutorial. - `hello-camkes-timer`: Add part-2 to tutorial for describing how to use new seL4DTBHardware camkes connector. - `camkes-vm-crossvm`: Add error message if build configuration is incorrect. @@ -24,10 +24,10 @@ SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. - `hello-camkes-2`: Fix error in hint in task 8. - Refactor tutorial build system to better match typical usage in other project. Previously the tutorials indicated that their build scripts shouldn't be used outside of the tutorial project, but this is no longer the case. -- `dynamic-4`: Update platform timer API's to use ltimer interface. +- `libraries-4`: Update platform timer API's to use ltimer interface. - `mcs`: Support running tutorial on kernel master branch since mcs branch was merged. - `mapping`: Remove seL4_X86_Page_Remap invocation from tutorial as kernel function had been removed. -- `dynamic-1`: fix completion text for task-3. +- `libraries-1`: fix completion text for task-3. - `hello-camkes-1`: Update instructions to match source code layout. - `untyped`: Make sure that untyped being used in tutorial doesn't correspond to a device. diff --git a/index.md b/index.md index dee4f9691b..c205f58261 100644 --- a/index.md +++ b/index.md @@ -12,18 +12,18 @@ This documentation site is for cooperatively developing and sharing documentatio -
+
-

Getting started

+

Resources

Information about working with seL4 and its ecosystem

@@ -41,39 +41,36 @@ This documentation site is for cooperatively developing and sharing documentatio
  • Style Guide
  • -
    -
    +
    +
    -

    Projects

    -

    List and details of all the projects that make up the seL4 platform.

    - - -
    +

    Projects

    +

    List and details of all the projects that make up the seL4 platform.

    + +
    -

    Tutorials

    -

    Tutorials and other material to learn about seL4.

    - - +

    Tutorials

    +

    Tutorials and other material to learn about seL4.

    +
    -
    - - - + \ No newline at end of file diff --git a/projects/buildsystem/index.md b/projects/buildsystem/index.md index 5423b99bd5..9a1c411bec 100644 --- a/projects/buildsystem/index.md +++ b/projects/buildsystem/index.md @@ -35,9 +35,9 @@ the actual build. It is assumed that * CMake of an appropriate version is installed - * You are using the Ninja CMake generator + * You are using the Ninja CMake generator * You understand how to checkout projects using the repo tool as described on the - [Getting started](/GettingStarted) page + [Resources](/Resources) page * You have the [required dependencies](/HostDependencies) installed to build your project. diff --git a/projects/camkes/index.md b/projects/camkes/index.md index fafa35d7eb..efcd8f07ae 100644 --- a/projects/camkes/index.md +++ b/projects/camkes/index.md @@ -30,7 +30,7 @@ The development framework provides: ## Get Camkes -- Make sure that you already have the tools to [build seL4 and Camkes](/GettingStarted#setting-up-your-machine). +- Make sure that you already have the tools to [build seL4 and Camkes](/Resources#setting-up-your-machine). - Download Camkes: ``` @@ -58,7 +58,7 @@ ninja To learn about developing your own CAmkES application, read the -[Tutorials#CAmkES_tutorials](/Tutorials#camkes-tutorials). +[Tutorials#CAmkES_tutorials](/tutorials#camkes-tutorials). ## Camkes Terminology/Glossary diff --git a/projects/sel4-tutorials/debugging-guide.md b/projects/sel4-tutorials/debugging-guide.md index 423aca56cc..4c94cc259f 100644 --- a/projects/sel4-tutorials/debugging-guide.md +++ b/projects/sel4-tutorials/debugging-guide.md @@ -2,6 +2,7 @@ toc: true redirect_from: - /DebuggingGuide +layout: tutorial SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. --- diff --git a/projects/sel4/documentation.md b/projects/sel4/documentation.md index 8e9c22e610..f1c36bd32f 100644 --- a/projects/sel4/documentation.md +++ b/projects/sel4/documentation.md @@ -11,7 +11,7 @@ SPDX-FileCopyrightText: 2020 seL4 Project a Series of LF Projects, LLC. - [Technical overview paper](https://trustworthy.systems/publications/nictaabstracts/Klein_AEMSKH_14.abstract) - [L4 Microkernels: The Lessons from 20 Years of Research and Deployment](https://trustworthy.systems/publications/nictaabstracts/Heiser_Elphinstone_16.abstract), a retrospective explaining how we got to where we are; -- [Getting started](/GettingStarted) +- [Resources](/Resources) - [Trustworthy Systems seL4 research project pages](https://trustworthy.systems/projects/seL4/) - [UNSW Advanced OS lecture slides](https://www.cse.unsw.edu.au/~cs9242/14/lectures/), especialy the Introduction and diff --git a/projects/sel4/frequently-asked-questions.md b/projects/sel4/frequently-asked-questions.md index fab555f597..49cabe853a 100644 --- a/projects/sel4/frequently-asked-questions.md +++ b/projects/sel4/frequently-asked-questions.md @@ -627,7 +627,7 @@ There are two recommended ways to do this. processes, but is generally more low-level. For build instructions, and how to get started, see the -[Getting started](/GettingStarted) page. +[Resources](/Resources) page. Also, UNSW's [Advanced Operating Systems course](https://www.cse.unsw.edu.au/~cs9242) has an extensive project component that builds an OS on top of seL4. If you have access to an [Odroid-C2](https://www.hardkernel.com/shop/odroid-c2/), you should be able to do the project work yourself as a way of