How pok-kernel/pok works
Project type and purpose
• This is POK, a secure, safety-critical microkernel for embedded systems (ARINC653-compliant RTOS).
• It provides core kernel services (threads, time, partitions, synchronization), middleware APIs (ports, queues, sampling, blackboards), hardware drivers (network, console), and user-level libraries (libpok, libm, libc).
High-level architecture components
a. Kernel core
• Subsystems: bootloader, scheduler (time-partitioned & priority), thread manager, inter-partition communication, memory manager, error handling
b. Architecture abstraction layer
• Per-CPU implementations (x86, PPC, SPARC) under kernel/arch
• CPU context switch, interrupts, timers, syscalls
c. Device drivers
• Network card (rtl8029), console, other BSP code
d. Middleware services (within kernel/middleware)
• Ports: virtual, sampling, queueing, blackboards
• Resource management
e. User-level support libraries (libpok)
• Core API wrappers, ARINC653 bindings, C runtime (libc, libm)
f. User applications & examples
• Partition code in examples/, ARINC653 models in AADL
g. Build & test infrastructure
• Makefiles, ldscripts, test suite under testsuite/, CI pipelines
Component relationships & interactions
• User application (partition) → libpok API → software interrupt/syscall → kernel core
• Kernel core ↔ architecture layer (trap, context switch) ↔ hardware
• Kernel core ↔ device drivers ↔ hardware peripherals
• Kernel core ↔ middleware components (in-kernel) providing communication primitives
• Build/test tools orchestrate cross-compilation and QEMU/emulation
Key architectural patterns & principles
• Microkernel separation: minimal in-kernel code; services run in isolated partitions or libraries
• ARINC653 time-partitioning: fixed major cycles, partition slots
• Pluggable architecture support: each arch in its own directory with a common syscall interface
• Layered design: hardware abstraction → kernel core → middleware → user libs → applications
Technologies & frameworks
• C language, assembly for low-level arch code
• Makefile-driven build, ldscripts for linking kernel & partitions
• AADL models for ARINC653 configuration (examples/*.aadl)
• QEMU targets (x86-qemu, ppc prep, sparc leon3) for testing
• Continuous integration: Travis CI, GitHub Actions