|
RTE OSAdapter POSIX 0.1.0 build 41b3eb3
POSIX/Linux OAL OSAdapter for Platform_RTE
|
The OSA Capella model (OSA-ARCH-CAP 0.1, 2026-10-02) sets six rules for the OS layer under RTE. This page records how this adapter stands against them (gap G4 of the root docs/architecture/CAPELLA_ARCHITECTURE_BASELINE.dox). Read-only audit of every source file; the two plain bugs it found are fixed (section "Fixed"), the rest is open.
| Rule | Verdict | Main evidence |
|---|---|---|
| R1 Threads created only at init, static priority, fixed stack | Not met | pthread_create happens in start (task.c, timer.c), which restarts the thread; task threads: SCHED_FIFO, priority and stack size set on the attributes before creation since 2026-10-03, every return code checked, refusal reported with the ADR-018 inherited-scheduling fallback (see "Fixed"); timer threads: the creating thread's own policy and priority (explicit) and a fixed stack size (RTE_POSIX_TIMER_STACK_SIZE, 8 MiB) set on the attributes before creation since 2026-10-03, same checks and fallback (see "Fixed"), no priority of their own; task stack size optional (0 = default stack) |
| R2 Priority-inheritance mutexes; every wait bounded | Not met | PI mandatory in mutex.c since 2026-10-03 (create fails, no fallback); timed lock in the vtable since 2026-10-03 (lock_timed; Linux deadline on CLOCK_REALTIME, see "Fixed"); lock (pthread_mutex_lock) stays unbounded but has no production caller; memory-pool lock PI, created at init, and bounded (RTE_POSIX_MEM_LOCK_TIMEOUT_MS, default 50 ms) since 2026-10-03; every timer and task thread joined, one-shot and run-once included, join result checked, since 2026-10-04 (item 7 a, see "Fixed"); stop/suspend/destroy wake a timer or periodic task thread that waits for its deadline (one process-wide PI mutex + condition variable) instead of waiting up to one period, since 2026-10-04 (item 7 b-1, see "Fixed"), but pthread_join still waits with no bound for a callback/entry that is running (item 7 b-2); fprintf(stderr) logging takes the stdio lock |
| R3 Monotonic clock for cycles and supervision | Met for cycles; one known limit | Timer and periodic task threads paced by an absolute CLOCK_MONOTONIC deadline on every host since 2026-10-04 (item 8; since item 7 b-1 a timed condition wait: non-Apple hosts pthread_cond_timedwait() to the absolute deadline on a CLOCK_MONOTONIC condition variable, macOS pthread_cond_timedwait_relative_np() of the time left, the clock read again after every wake-up), no drift by the callback's run time; a failed clock read or wait is reported and stops the loop, never used as time 0 (items 8 and 7 b-1, see "Fixed"); IPC, netlink and channel-service deadlines on CLOCK_MONOTONIC. Known limit: the Linux timed-lock deadline is on CLOCK_REALTIME (R2 row, pthread_mutex_clocklock not usable on a PI mutex); the wake-mutex bound of item 7 b-1 inherits it, but the expiry is decided on CLOCK_MONOTONIC |
| R4 No dynamic allocation in operation | Partly met | No malloc/free. But getaddrinfo runs in netlink connect (reconnects are allowed after init by ADR-026) and in channel-service lazy re-init on any cycle while the socket is not open; pthread_create on each task/timer restart; rte_ipc_create, rte_nvm_open not gated |
| R5 Fixed-size IPC, non-blocking with timeout | Partly met | Netlink and channel service are non-blocking with deadlines; SO_RCVBUF/SO_SNDBUF from the link config (rcvbuf_bytes/sndbuf_bytes), set and confirmed before the link is handed out since 2026-10-03, but no production config sets them yet (see "Fixed"); IPC: queue_depth enforced, whole fixed-size messages only and pipe capacity checked at create since 2026-10-03 (see "Fixed"); posix_socket_open sets O_NONBLOCK since 2026-10-03 (checked, see "Fixed"); a channel-service listen-role send with no known peer sends nothing and returns RTE_STATUS_NOT_CONNECTED since 2026-10-04 (Platform_RTE REQ-CHANSVC-001, see "Fixed") |
| R6 Violations reported to RTE diagnostics as critical | Not met | The adapter never calls rte_lifecycle_* or rte_safestate_*; failed RT attributes are ignored with (void); RTE's lifecycle lock only returns INVALID_STATE and does not escalate |
RTE has no SYS_INIT/SYS_OPERATIONAL names; the equivalent boundary is rte_lifecycle (locked by rte_appmanager_run once init succeeds).