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 ..
makeFor 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 commitChecks for whitespaces and empty lines.
cmake -DENABLE_ASTYLE=ON ..
make formatInvokes the Astyle formatter.
cmake -DENABLE_CLANG_TIDY=ON ..
make tidyUses 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 checkCode analysis with CppCheck, focusing on undefined behaviour bugs.
cmake -DENABLE_MEMCHECK=ON ..
make memcheckMemory checker.
Coverage
cmake -DENABLE_COVERAGE=ON ..
makeEach sanitizer must be run stand alone, thus you cannot run them together.
Address sanitizer
cmake -DENABLE_ASAN=ON ..
makeUndefined behaviour sanitizer
cmake -DENABLE_USAN=ON ..
makeThread sanitizer
cmake -DENABLE_TSAN=ON ..
makeThe target make all_checks
cmake -DALL_CHECKS=ON ..
makewill 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_EmulatorThe 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.
