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.
Checkout the Wiki page for a detailed Documentation!
The simulator uses the SDL2 graphics libraries.
sudo apt-get install libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
sudo pacman -S sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf
¯\(°_o)/¯
....install linux?
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.
In test.cmake
a number of extra targets are provided to help with linting.
make commit
Checks for whitespaces and empty lines.
cmake -DENABLE_ASTYLE=ON ..
make format
Invokes the Astyle formatter.
cmake -DENABLE_CLANG_TIDY=ON ..
make tidy
Uses clang tidy to find style violations, interface misuse of bugs found via static analysis.
To generate a list of warnings/errors use the build target tidy_list
and then view the file tidy.fixes
.
cmake -DENABLE_CPPCHECK=ON ..
make check
Code analysis with CppCheck, focusing on undefined behaviour bugs.
cmake -DENABLE_MEMCHECK=ON ..
make memcheck
Memory checker.
Coverage
cmake -DENABLE_COVERAGE=ON ..
make
Each sanitizer must be run stand alone, thus you cannot run them together.
Address sanitizer
cmake -DENABLE_ASAN=ON ..
make
Undefined behaviour sanitizer
cmake -DENABLE_USAN=ON ..
make
Thread sanitizer
cmake -DENABLE_TSAN=ON ..
make
The target make all_checks
cmake -DALL_CHECKS=ON ..
make
will perform all checks
The binary will be created inside a bin
folder. The emulator should be run from this folder becuase at the moment the Gfx libraries rely on hardcoded resource paths for things such as fonts. As such to run perform the following.
cd bin
./FreeRTOS_Emulator
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.