
Design a Stable C ABI for a Shared Library
Keep a shared library's C interface stable across releases with opaque handles, size-tagged structs, explicit error codes and a versioned symbol set.
Tag
362 posts

Keep a shared library's C interface stable across releases with opaque handles, size-tagged structs, explicit error codes and a versioned symbol set.

Read a machine's NUMA nodes, per-node memory and distance matrix with numactl --hardware, then see caches and devices with lstopo from hwloc on Linux.

Send Zephyr printk and log output to a UART terminal or to SEGGER RTT, with the exact Kconfig lines, the chosen node and what to do when nothing prints.

Everything between exec and main in C on Linux: argv, envp and environ, getopt, the auxiliary vector, startup code, exit paths and passing a safe environment.

Learn how a microcontroller bootloader starts, validates and updates firmware, from the Cortex-M reset sequence to safe OTA, rollback and secure boot.

Unspecified, implementation-defined and undefined behavior are three different promises in C. Learn what each guarantees and how to tell them apart.

Write a UDP server and client in C with sendto and recvfrom on Linux, and learn why datagrams keep their boundaries but can be lost.

Build and run the STREAM benchmark with gcc and OpenMP to measure sustainable memory bandwidth, size the arrays so they miss cache, and read the four kernels.

Keep a Zephyr application in its own folder by setting ZEPHYR_BASE and finding Zephyr from CMake. Includes the layout, the build commands and the limits.

Build a real Unix command-line tool in C from argument parsing to exit codes, pipelines, locale, tests and a man page, with every step explained.

Build nRF52 and nRF53 firmware from first LED to BLE, power, DFU and the dual-core nRF5340 with the nRF Connect SDK, Zephyr and tested register-level code.

Write a Linux filesystem as a loadable module: file_system_type, the mount API, superblock, inodes, directories, page-cache I/O and a mount option, tested.