Core Kernel API Reference
This reference documents the public API surface of the TikuOS kernel. All declarations live in header files under kernel/; include tiku.h to pull in the full platform configuration, then include individual module headers as needed.
The API is organized into five modules, each covering a distinct responsibility of the kernel. Follow the cards below to dive into a specific area.
Modules
Process & Scheduler
Event-driven cooperative processes, protothreads, local continuations, typed channels, and the main scheduler loop.
kernel/process/ · kernel/scheduler/Timers & Clock
Software timers (event and callback modes), the system clock, and the single-shot hardware timer with ISR callbacks.
kernel/timers/Virtual Filesystem
A unified namespace for peripherals, OS state, config, and processes. Everything is a readable/writable path.
kernel/vfs/ · kernel/process/tiku_proc_vfs.hMemory Management
Arenas, pools, persistent NVM key-value store, MPU protection, tier allocators, write-back cache, hibernate/resume.
kernel/memory/CPU & Watchdog
Watchdog timer configuration, blocking delays, and LED utility helpers provided by the CPU abstraction layer.
kernel/cpu/Conventions
- Prefix — all public identifiers use the
tiku_prefix (orTIKU_for macros and constants). - Naming — functions follow
tiku_<module>_<action>(); types use the_tsuffix; header guards useTIKU_<MODULE>_H_. - Memory — everything is statically allocated. There is no heap; all buffers are caller-provided.
- Return codes — most functions return
0/positive for success,-1or a negative enum for error. Predicate functions return 0 or 1. - ISR safety — functions that must only be called from interrupt context are flagged explicitly in each module's documentation.
Minimal Example
The smallest useful program: a process that blinks an LED once per second using a software timer.
#include "tiku.h"
TIKU_PROCESS(blink_process, "Blink");
static struct tiku_timer timer;
TIKU_PROCESS_THREAD(blink_process, ev, data)
{
TIKU_PROCESS_BEGIN();
tiku_common_led1_init();
tiku_timer_set_event(&timer, TIKU_CLOCK_SECOND);
while (1) {
TIKU_PROCESS_WAIT_EVENT_UNTIL(ev == TIKU_EVENT_TIMER);
tiku_common_led1_toggle();
tiku_timer_reset(&timer);
}
TIKU_PROCESS_END();
}
TIKU_AUTOSTART_PROCESSES(&blink_process);