Hasty Briefsbeta

Mini-init-asm: A tiny PID 1 for containers, written in x86-64 NASM and ARM64 GAS

3 days ago
  • #container-init
  • #linux
  • #assembly
  • mini-init-asm is a tiny PID 1 for containers, written in x86-64 NASM and ARM64 GAS.
  • It spawns the target process as its own process group, forwards signals to the whole group, reaps zombies, and optionally restarts the app on crash.
  • Supports x86-64 Linux (native NASM build) and arm64/AArch64 (cross-build via GNU toolchain).
  • Features include: creating a new session + process group for the app, forwarding signals to the entire group, reaping zombies, graceful shutdown with configurable timeout, and optional restart on crashes.
  • Configuration is primarily through environment variables with minimal CLI flags.
  • Comparison with Tini shows differences in language, architectures, binary type, signal handling, and features like restart-on-crash.
  • Installation and usage instructions provided for both x86-64 and ARM64 architectures.
  • Includes a detailed explanation of the high-level algorithm and key syscalls used.
  • Project structure and testing methodology are outlined, including e2e tests and edge-case integration tests.