|
RADLib
RADical C++ application framework
|
RADEmbeddedKernel is RADLib's portable embedded kernel service layer. It gives bare-metal and simulator targets a small POSIX-like contract for tasks, events, time, VFS access, devices, bus transfers, audio devices, terminal commands, and memory accounting.
RADPx OS is now the main operating-system repository for x86 VM work, processes, POSIX compatibility, packageable services, and broader architecture ports. RADEmbeddedKernel remains useful as the RADLib-side embedded runtime module and as a source-compatible bridge for MCU-class and simple bare-metal targets.
The public interface is a C ABI with lightweight C++ wrappers. The C ABI is the stable boundary for future embedded plugins and for source-distributable HAL adapters. The C++ wrappers are convenience helpers for RADLib applications.
linux_sim is the first functional backend. It maps kernel services to desktop threads, filesystems, clocks, mutexes, events, and fake devices so behavior can be validated in CI before hardware testing.
rp235x_pico is the first MCU-class backend. It targets RP2350/RP2354 A/B Cortex-M33 devices through the Pico SDK, defaults to PICO_BOARD=pico2 and PICO_PLATFORM=rp2350-arm-s, and is configured by RADLib's Python/JSON build flow before CMake is invoked.
circle_pi is the first Raspberry Pi bare-metal backend. It targets Pi Zero 2 W through Circle and uses Circle's native Makefile flow for the smoke image. Circle remains optional; RADEmbeddedKernel is not architecturally tied to Circle.
The first-pass kernel surface includes:
/dev/console, /dev/serial0, /dev/uart0, and /dev/ttyS0rad_kernel_poll(), rad_kernel_run(), rad_kernel_request_shutdown(), and rad_kernel_is_shutdown_requested()Built-in terminal commands include help, tasks, mem, mounts, ls, cat, devices, time, and bootinfo. On embedded backends, unsupported commands return RAD_STATUS_NOT_SUPPORTED instead of failing silently.
RP235x normal VFS storage is SD-card only in this pass. Flash is intentionally not exposed as a normal writable filesystem. SPI SD is the conservative baseline path. Optional 4-bit PIO SDIO is exposed behind RADEKERNEL_ENABLE_SDIO_PIO=ON and RADEKERNEL_SD_MODE=pio_sdio or auto.
PIO SDIO requires correct board wiring: SD CLK, CMD, and four consecutive data GPIOs. The preferred integration candidate is inindev/pico-fatfs-sd, a trimmed RP2040/RP2350 FatFs SDIO/SPI driver with RP2350B GPIO support. The kernel exposes the HAL seam for this driver, but the external driver is not vendored into RADLib by default.
Embedded settings live in buildconfig.json under embedded and can be overridden by build.py flags. Committed defaults are intentionally portable: machine-local SDK, Circle, and toolchain paths should be supplied by local config, environment, or command-line flags instead of being committed.
pico_sdk_pathcircle_roottoolchain_dirpico_boardpico_platformsd_modeenable_sdio_pioenable_psram./build.py --build-embedded --embedded-target rp235x configures the Pico SDK smoke project and emits the usual Pico artifacts when arm-none-eabi is available. ./build.py --build-embedded --embedded-target circle builds the Circle Pi Zero 2 W smoke image when Circle and aarch64-none-elf are available.
RADpm package-manager development is separate from embedded HAL builds:
Small targets compile only the services they need and provide fixed-pool or static backing storage through the HAL. Pi-class and Zynq-class targets can enable the fuller VFS, terminal, and device registry model. MCU-class targets such as RP2040 and RP2350 start with time, events, device registry, bus dispatch, memory pools, serial shell, and SD-card VFS hooks.
The public headers and HAL adapter sources can be shared across ports, but the kernel archive itself must be built per architecture, ABI, and toolchain. A Cortex-M RP2350 build, a Cortex-A AArch64 Raspberry Pi build, and a Zynq A9 build cannot consume one universal static archive. They should instead ship as target-specific archives such as libradekernel-rp2350-cortex-m33.a, libradekernel-aarch64-none-elf.a, or libradekernel-zynq-a9.a, all exposing the same radekernel C ABI.
Dynamic ELF/plugin loading is not part of the first pass. The ABI is shaped so a future loader can pass a kernel API table to trusted plugins. User/kernel privilege separation is also out of scope for this preview; early embedded plugins and tasks should be treated as trusted code.
The RP235x boot shim is deliberately small: no filesystem, no dynamic allocation, and no shell. It prepares the boot handoff struct and jumps into the kernel entry path. The target budget is under 8 KiB of code and under 1 KiB of RAM for the shim.