Features
Features
LightOS is purpose-built for silicon validation and embedded firmware development. Every feature is designed for deterministic behavior, minimal footprint, and production readiness.
โก Ultra-Fast Boot
<5ฮผs Cold Boot
Boot your entire RTOS in less than 5 microseconds. Critical for silicon validation where every simulation cycle counts.
Why It Matters:
- Run 1000x more test iterations in the same simulation time
- Instant firmware bring-up on RTL
- No waiting for scheduler initialization
How We Achieve It:
- Minimal startup code path
- Static memory allocation options
- No runtime initialization overhead
- Direct hardware register writes
๐งต Thread Management
Priority-Based Scheduler
- 32 priority levels (0-31)
- Preemptive multitasking
- Round-robin within priority
- O(1) scheduling decisions
Thread States
- Running, Ready, Suspended
- Blocked (mutex, semaphore, queue)
- Sleeping (time-bounded)
- Terminated
Stack Management
- Configurable stack sizes
- Stack overflow detection
- Stack usage watermarking
- Per-thread TLS support
Thread Control
- Create, Destroy, Suspend, Resume
- Dynamic priority changes
- Join/detach semantics
- Cooperative yield
Example:
#include <lightos/thread.hpp>
lightos::thread worker("Worker", priority::normal, [](void*) {
while (true) {
process_task();
lightos::thread::yield();
}
});
worker.start();
๐ Synchronization Primitives
Mutex
- Priority inheritance (optional)
- Recursive locking support
- Timeout-based acquisition
- Deadlock detection (debug)
Semaphore
- Binary and counting
- Producer/consumer patterns
- ISR-safe release
- Timeout support
Message Queue
- Type-safe with C++ templates
- Fixed-size messages
- Blocking send/receive
- Non-blocking variants
Condition Variable
- Wait/notify semantics
- Broadcast support
- Timeout wait
- Spurious wakeup handling
Example:
#include <lightos/mutex.hpp>
#include <lightos/queue.hpp>
lightos::mutex data_lock;
lightos::queue<sensor_reading, 16> sensor_queue;
// Producer (ISR context)
void sensor_isr() {
sensor_queue.send_from_isr(reading);
}
// Consumer (thread context)
void consumer_thread() {
auto reading = sensor_queue.receive(timeout::infinite);
scoped_lock lock(data_lock);
process(reading);
}
โฑ๏ธ Timer System
Hardware Timers
- ARM Generic Timer support
- RISC-V CLINT/MTIMER
- Tick-based and tickless modes
- Sub-microsecond resolution
Software Timers
- One-shot and periodic
- Callback execution
- Timer pools for efficiency
- ISR-deferred processing
Time APIs
- System uptime
- Wall-clock time (optional RTC)
- Timeout handling
- Delay functions
Power-Aware
- Tickless idle for power saving
- Dynamic tick adjustment
- DVFS integration
- Wake-on-event
๐พ Memory Management
Static Pools
- Zero heap allocation option
- Compile-time sizing
- Deterministic allocation
- No fragmentation
Dynamic Pools
- Block allocators
- Per-subsystem pools
- Runtime configuration
- Allocation tracking
MPU/MMU Support
- Memory protection regions
- User/kernel isolation
- Fault handling
- AUTOSAR OS-Application support
Debug Features
- Memory leak detection
- Buffer overflow checks
- Allocation statistics
- Watermark tracking
๐๏ธ Architecture Support
| Architecture | Features | Status |
|---|---|---|
| ARM Cortex-R52 | EL1/EL2, GICv3, MPU, VFP | โ Hardware Verified |
| ARM Cortex-A53 | MMU, Kernel/User, Syscalls | โ QEMU Tested |
| RISC-V RV64GC | CLINT, PLIC, SMP | โ QEMU Tested |
| RISC-V RV32IMC | Embedded targets | โ QEMU Tested |
๐ Language Bindings
C++ (Native)
Modern C++20 API with RAII, type safety, and zero-cost abstractions.
C API
Full C99 API for legacy codebases and integration.
Rust FFI
#![no_std] compatible bindings for Rust embedded development.
use lightos_ffi::*;
let thread = Thread::new("Worker", Priority::Normal, worker_fn)?;
thread.start()?;
๐ก๏ธ Safety & Security
ISO 26262 ASIL-B
- Timing protection
- Memory isolation
- Watchdog integration
- Error recovery
TrustZone Support
- Secure/Non-secure worlds
- Secure boot
- Cryptographic services
- Key management
Fault Handling
- Exception handlers
- Stack overflow protection
- MPU violation handling
- Graceful degradation
AUTOSAR OS
- OS-Application model
- Trusted functions
- Inter-app communication
- Service protection
๐ Debugging & Profiling
- ETM/ITM trace for ARM targets
- Semihosting for printf debugging
- QEMU integration for development
- Trace32/J-Link debug support
- Built-in statistics for CPU, memory, stack usage
Ready to Evaluate?
Performance Disclaimer: Performance metrics such as boot times, memory usage, and latency figures are measured under specific test conditions (ARM Cortex-R52 simulation environment, default configuration). Actual performance may vary significantly depending on hardware platform, compiler, configuration options, and application workload. These figures are provided for general guidance only.
Safety Disclaimer: “ASIL-B ready” and similar statements indicate that LightOS is designed with ISO 26262 automotive safety requirements in mind and includes supporting documentation. This does not constitute certification. Final safety certification is the responsibility of the system integrator and their designated assessment body.