roemvaar / oso

OSo ("bear" in Spanish) is a microkernel for embedded systems. It currently support Raspberry Pi 4 Model B.
MIT License
0 stars 1 forks source link

OSo

OSo ("bear" in Spanish) is a microkernel for embedded systems as designed and developed by Roberto Valenzuela (roemvaar). It currently supports Raspberry Pi 4 Model B.

Build Status

master: <img alt="Coverity Scan Build Status" src="https://scan.coverity.com/projects/30303/badge.svg"/>

Design Goals

Small operating system with a "real-world" application.

Start from scratch to get a better understanding of things that you may take for granted, such as booting, device interaction, memory management, timing, threading and concurrency.

Documentation

The documentation for the project is in the Wiki page.

The assignment-related files are stored on the course site (here).

Equipment

Software Prerequisites

The RPi4 boot mechanism is closed source, therefore, we need to install Raspbian OS. See the official documentation for detailed instructions. After you make sure that your RPi4 is booting Raspbian correctly, we are going to be able to boot our own code (explained in the next section).

Build

First, install the cross toolchain, instructions here.

$ make X_DIR=/path/to/cross_toolchain

Make sure to specify the path to the cross toolchain on your dev machine.

Usage

The make command will produce kernel8.img, which is a memory image of our kernel. This binary is the one that needs to be deployed to the RPi4 and run. The steps consists of flashing the image into the SD card, then inserting it into the RPi4, then powering the board, and the kernel should start booting and running the user space "applications".

To build and test the kernel follow this instructions:

  1. Build code
$ make
  1. Copy the generated kernel8.img file to the boot partition of the RPi4 flash card. Make sure that you leave all other files in the boot partition untouched.

  2. Connect the USB-to-TTL serial cable.

$ sudo picocom -b 115200 /dev/ttyUSB0
  1. Power on the Raspberry Pi 4.

  2. On the terminal, you should be able to see the OS booting.

Debugging

$ make debug

The debug target produces the objdump.txt and readelf.txt that help to debug the kernel.

Authors

Roberto Valenzuela (roemvaar).

Acknowledgements

We stand on the shoulders of giants.

Here are some useful resources that we have encountered regarding developing a kernel, real time or otherwise.

License

MIT license.