FAQ
Frequently Asked Questions
Common questions about LightOS RTOS.
General
What is LightOS?
LightOS is a modern C++20 real-time operating system designed for safety-critical embedded systems. It supports ARM Cortex-R52 and RISC-V architectures with hardware-verified reliability.
Is LightOS open source?
Yes! LightOS is available under the MIT license. See our GitHub repository.
What architectures are supported?
- ARM Cortex-R52 - Primary target, hardware-verified
- RISC-V RV64GC - Full support with SMP
- x86/x64 - For host simulation and unit testing
What’s the minimum memory footprint?
- RAM: ~4KB minimum (kernel + one thread)
- Flash: ~16KB minimum (core kernel)
- Scales based on features enabled
Development
What compiler do I need?
- Host builds: GCC 10+, Clang 12+, or MSVC 2019+
- ARM targets: arm-none-eabi-gcc 10+
- RISC-V targets: riscv64-unknown-elf-gcc 10+
How do I run tests?
cmake -B build
cmake --build build
./build/lightos_unit_tests
All 1122 tests should pass.
Can I use LightOS with my existing C code?
Yes! LightOS provides both C++ and C APIs:
#include <lightos/lightos.h>
// C API
lightos_thread_create(task, NULL, 1024, 5);
lightos_scheduler_start();
Does LightOS support POSIX?
Yes, LightOS includes a POSIX compatibility layer:
- pthreads (create, join, mutex, conditions)
- Semaphores (sem_*)
- POSIX timers (timer_*)
- Thread-local storage (pthread_key_*)
- Spinlocks (pthread_spin_*)
Real-Time Performance
What’s the interrupt latency?
- Typical: < 1μs on Cortex-R52 @ 400MHz
- Worst-case: < 5μs with all features enabled
Does LightOS support preemption?
Yes, LightOS uses priority-based preemptive scheduling. Higher-priority threads preempt lower-priority ones immediately.
How many priority levels are there?
256 priority levels (0 = highest, 255 = lowest). The idle thread runs at priority 255.
Is there priority inheritance?
Yes, mutexes support priority inheritance to prevent priority inversion.
Safety & Certification
Is LightOS safety-certified?
LightOS is designed for safety-critical applications and follows MISRA C++ guidelines. Formal certification (ISO 26262, DO-178C) is available through our enterprise support.
What safety features are included?
- Stack overflow detection
- Watchdog timer integration
- MPU/MMU support for memory protection
- Fault handlers with crash dump
- Static analysis compliance (cppcheck, clang-tidy)
Is there formal verification?
Yes, critical components are formally verified using model checking. See our UVM verification suite.
Build & Integration
How do I add LightOS to my project?
Option 1: Git submodule
git submodule add https://github.com/jiangintel-ux/lightOS.git
Option 2: CMake FetchContent
include(FetchContent)
FetchContent_Declare(lightos
GIT_REPOSITORY https://github.com/jiangintel-ux/lightOS.git
GIT_TAG main
)
FetchContent_MakeAvailable(lightos)
target_link_libraries(myapp lightos)
How do I configure features?
Use CMake options:
cmake -B build \
-DLIGHTOS_POSIX_ENABLED=ON \
-DLIGHTOS_SMP_ENABLED=ON \
-DLIGHTOS_COVERAGE=ON
Can I disable features to reduce size?
Yes, most features can be disabled at compile time:
cmake -B build \
-DLIGHTOS_POSIX_ENABLED=OFF \
-DLIGHTOS_USB_ENABLED=OFF \
-DLIGHTOS_CAN_ENABLED=OFF
Debugging
How do I debug on target?
LightOS supports:
- SEGGER J-Link with RTT output
- SEGGER SystemView for real-time tracing
- Lauterbach TRACE32 scripts included
- GDB with OpenOCD
How do I enable debug output?
#define LIGHTOS_DEBUG_ENABLED 1
#include <lightos/debug.hpp>
LIGHTOS_DEBUG("Value: %d", value);
Where are the trace scripts?
See scripts/trace32/ for Lauterbach TRACE32 scripts.
Troubleshooting
Build fails with “C++20 required”
Ensure you’re using a compatible compiler:
export CXX=g++-13
cmake -B build
Tests fail on host
Make sure you’re building in Debug mode:
cmake -B build -DCMAKE_BUILD_TYPE=Debug
QEMU doesn’t start
Install QEMU with ARM/RISC-V support:
# Ubuntu/Debian
sudo apt install qemu-system-arm qemu-system-misc
Getting Help
- GitHub Issues: Report bugs
- Discussions: Ask questions
- Contact: Contact form