/FreeRTOS-Emulator

POSIX based FreeRTOS emulator with SDL2 graphics interface, aiming to make it possible to teach FreeRTOS without embedded hardware

Primary LanguageCGNU General Public License v3.0GPL-3.0

FreeRTOS Emulator

An implementation of POSIX based FreeRTOS with the combination of SDL2 graphics. Aimed at providing an x86 emulation solution for teaching FreeRTOS to students without the need of embedded hardware.

Based on the FreeRTOS (V5.X) simulator developed by William Davy. Updated to use FreeRTOS V9.0.0.

Dependencies

The simulator uses the SDL2 graphics libraries.

Debian/Ubuntu

sudo apt-get install libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev

Arch

sudo pacman -S sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf

Windows/Mac

¯\(°_o)/¯

....install linux?

Building

cd build
cmake ..
make

For those requiring an IDE run

cmake -G "Eclipse CDT4 - Unix Makefiles" ./

to generate the appropriate project files to allow for the emulator to be imported into Eclipse.

Debugging

The emulator uses the signals SIGUSR1 and SIG34 and as such GDB needs to be told to ignore the signal. An appropriate .gdbinit is in the bin directory. Copy the .gdbinit into your home directory or make sure to debug from the bin directory. Such that GDB does not get interrupted by the POSIX signals used by the emulator for IPC.

If using an IDE, make sure to configure your debug to load the gdbinit file.

Documentation

Documentation of the crude graphics library, found in lib/Gfx, and the example collision demo code library, can be generated by running

doxygen

from the docs directory to generate the Doxygen documentation. Also generated on GitHub via Travis CI, available here.

Example

Pong game implementation on pong branch

State of Simulator

Work in progress.

TODO:

  • Async IO

Buy Me A Coffee

YouCompleteMe Integration

This is not really related to the project but as I have left in the YCM symlinks and options in the CMake I may as well detail the YouCompleteMe Vim integration as it is applicable for other projects as well.

Install vim-plug

Ubuntu users

Ubuntu does not yet install vim 8.X+ by default and as you must install it manually first

sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim

Installation

Prerequisites

A python version >= 3.5 is required.

sudo apt install build-essential cmake3 python3.5-dev python3.5
Vim plugin manager
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
YCM

Add YCM to vimrc

echo "call plug#begin('~/.vim/plugged')" >> $HOME/.vimrc
echo "Plug 'valloric/youcompleteme'" >> $HOME/.vimrc
echo "call plug#end()" >> $HOME/.vimrc

Start vim and run :PlugInstall

Navigate to vim plugin folder and run install script

cd $HOME/.vim/plugged/youcompleteme
python3.5 install.py --clang-completer

Get the config script

curl -Lo $HOME/.ycm_extra_conf.py https://raw.githubusercontent.com/alxhoff/dotfiles/master/ycm/.ycm_extra_conf.py

After running, you should be able to complete using CRTL+Space