
The Complete Guide to Program Startup: argv, envp and main
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.
Tag
445 posts

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.

Read /proc/PID/cgroup to see which cgroup a process is in, then use systemd-cgls and systemd-cgtop to walk the whole tree and find a container's group.

Cut a clip from a video with FFmpeg and know when -ss, -to and -t land on the exact frame, and when stream copy snaps to the nearest keyframe.

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.

A COBOL PICTURE clause sets a field's size and type. Learn the symbols 9, X, A, S and V and the editing symbols Z, comma, point, dollar, star and CR.

Drive an LED and read a button from the shell with gpioset and gpioget from libgpiod 2.1 on Linux 6.12, including toggling, timed pulses and bias.

Write a Thumb-2 function in a .S file, declare it in C, build with arm-none-eabi-gcc 14 and see exactly how arguments and the result travel in registers.

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.

Learn when to use = and <= in Verilog, how the simulator schedules each, and what goes wrong when you mix them in clocked or combinational blocks.