TinyOS🐞: Operating System Tutorial

1 minute read

Published:

TinyOS🐞 is a tutorial series about minimal operating system kernel implementation based on the comprehensive tutorial series mini-risscv-os. This operating system kernel is based on RISC-V instruction set architecture. Credits goes to the original authors of mini-risscv-os. A fully built environment is available as a docker environment. This tutorial will cover several chapters related to implementing a operating system from begining.

Requirements

In order to complete the tutorial you just need only two things

  1. TinyOS repo
  2. Docker

Beyond the technical requirements, inorder to understand the concepts I highly recommend looking at my firmware tutorial series before starting on this.

Setup the Environement on Docker

Fully bulid docker environemt with all the requirements installed including

  • gcc toolchain
  • qemu with RISC-V simulator

can be found in the following docker-hub reposiroty.

You can follow the below instructions to get it mount on your docker stack.

  1. Pull the docker container
    docker pull archfx/rvutils:qemu 
    
  2. clone this repository
    git clone https://github.com/Archfx/tinyos 
    
  3. Mount the repo to the docker container
    docker run -t -p 6080:6080 -v "${PWD}/:/tinyos" -w /tinyos --name rvutils archfx/rvutils:qemu
    
  4. Open the docker environment in another terminal
    docker exec -it rvutils /bin/bash
    

Chapters

This tutorial series contains following chapters.

Building and Simulation

Instead of following through the tutorial, you can direclty compile and run the simulation from the repository. To do that you can navigate direcltly to the folder and use followings commamds from inside the Docker instance of archfx/rvutils:qemu

make # Build the OS
make qemu # Simulate the OS

Note: Press Ctrl-A and then X to exit QEMU

References