Show HN: TinyOS – A minimalist RTOS for Cortex-M written in C

TinyOS is an ultra-lightweight real-time operating system designed for resource-constrained IoT devices, featuring a kernel footprint under 10 KB and full support for modern networking protocols.
An ultra-lightweight real-time operating system for resource-constrained IoT and embedded devices.
Kernel footprint under 10 KB, 2 KB minimum RAM, preemptive priority-based scheduling.
| Category | Details | |---|---| | Kernel | Preemptive priority-based scheduling (256 levels), round-robin within same priority, O(1) priority lookup via bitmap, priority inheritance | | Synchronization | Mutex (with priority inheritance), semaphore, condition variable, event groups, message queues | | Software Timers | One-shot and auto-reload, millisecond precision, period change at runtime | | Memory | Fixed-block pool allocator, stack overflow detection, per-task high-water mark | | Shell | VT100 interactive shell — 19 built-in commands, command history (↑↓), tab completion, full line editor | | File System | Lightweight block-device FS, POSIX-like API, wear levelling, power-fail safe | | Network | Ethernet, IPv4, ICMP, UDP, TCP, HTTP client/server, DNS | | TLS / DTLS | TLS 1.2/1.3 over TCP, DTLS 1.2 over UDP (mbedTLS backend) | | MQTT | Full MQTT 3.1.1 — QoS 0/1/2 with in-flight retry table, offline queue, auto-reconnect with exponential back-off | | CoAP | RFC 7252 compliant client/server, observe pattern | | OTA | A/B partition firmware updates, CRC32 verification, rollback | | Watchdog | Hardware and software watchdog, per-task timeout monitoring | | Power | Idle / Sleep / Deep-sleep modes, tickless idle, CPU frequency scaling | | Security | MPU-based memory protection, secure boot support |
| Architecture | Examples | |---|---| | ARM Cortex-M (M0/M0+/M3/M4/M7) | STM32, nRF52, Raspberry Pi Pico | | RISC-V (RV32I) | ESP32-C3 | | AVR (experimental) | ATmega |
Prerequisites: gcc-arm-none-eabi
make example-blink # LED blink
make example-shell # Interactive shell over UART
make example-mqtt # MQTT publish/subscribe
make example-iot # Multi-sensor IoT node
make size # Binary size report
Minimal task example:
#include "tinyos.h"
void my_task(void *param) {
while (1) {
/* work */
os_task_delay_ms(100);
}
}
int main(void) {
tcb_t task;
os_init();
os_task_create(&task, "my_task", my_task, NULL, PRIORITY_NORMAL);
os_start();
}
Source: Hacker News











