How h-000-h/mini-os works
mini-os is a freestanding, single-core RTOS kernel for microcontrollers. Its user-facing workflow is an application creating threads and kernel objects; the scheduler selects runnable threads, tick processing releases delays and timeouts, and the architecture port performs context switches. Synchronization, message queues, timers, and memory management are distinct supporting capabilities. README documents optional features and additional architecture ports whose detailed implementations were not sampled, so those links are limited to documented ownership.
Main entry points: thread.c Thread lifecycle · schedule.c Priority scheduler · timer.c Timer service · semaphore.c Semaphores
Components 15
Thread execution
- Thread lifecycle
src/thread.c - Priority scheduler
src/schedule.c
Synchronization and communication
- Semaphores
src/semaphore.c - Mutexes
src/mutex.c - Event groups
src/event.c - Message queues
src/queue.c
Time services
- Timer service
src/timer.c - Thread tick wheel
src/schedule.c - System tick
inc/port.h
Memory management
- Heap allocator
src/memory.c
Architecture support
- Cortex-M port
arch/arm/cortex-m/port/port.c - Context switch
arch/arm/cortex-m/port/port.S - RISC-V port
arch/risc-v/port.c - ARM port
arch/arm/cortex-m/port/port.c
Other components
- Application
Connections 23
- Application → Thread lifecycle: creates threads
- Application → Semaphores: uses
- Application → Mutexes: locks
- Application → Event groups: waits on
- Application → Message queues: sends and receives
- Application → Timer service: configures
- Thread lifecycle → Heap allocator: allocates
- Thread lifecycle → Priority scheduler: makes runnable
- Priority scheduler → Context switch: requests switch
- Context switch → Thread lifecycle: restores thread
- Cortex-M port → Context switch: dispatches SVC
- RISC-V port → Priority scheduler: provides port
- Mutexes → Semaphores: parks waiters
- Semaphores → Thread lifecycle: blocks and wakes
- Message queues → Thread lifecycle: blocks and wakes
- Event groups → Thread lifecycle: blocks and wakes
- System tick → Priority scheduler: advances tick
- Priority scheduler → Thread tick wheel: expires waits
- System tick → Timer service: advances wheel
- Timer service → Semaphores: wakes service thread
- Timer service → Priority scheduler: requests ISR switch
- Mutexes → Priority scheduler: recomputes priority
- Thread lifecycle → Heap allocator: frees terminated threads