PX4 startup is controlled by shell scripts in the firmware. On NuttX, these reside in ROMFS/px4fmu_common/init.d/. The entry point is rcS, which detects the board, loads parameters, selects the airframe script, and starts all modules.
Airframe configuration files are numbered scripts (e.g. 10000_airplane, 4001_quad_x) that set default parameters for a specific vehicle type. These are exported to airframes.xml at build time for QGroundControl's airframe selection UI.
Boot sequence
On POSIX (Linux/macOS SITL), the same rcS logic runs via px4 binary with symbolic links
SD card customization
/etc/config.txt: param overrides loaded before modules start. /etc/extras.txt: starts extra applications after the main boot. /etc/rc.txt: completely replaces the default boot (use with caution). These files use UNIX line endings.
bash
# Example /etc/config.txt on SD card param set-default MC_ROLLRATE_P 0.18 param set-default MC_PITCHRATE_P 0.18 param set-default EKF2_AID_MASK 1 # Example /etc/extras.txt set +e custom_payload_app start set -e
On POSIX systems (Linux/macOS SITL), PX4 runs as a single process. Modules are started as threads. The px4 binary creates symbolic links (px4-commander, px4-navigator, etc.) so each module looks like a separate executable. The shell communicates with the main instance via a UNIX socket.
bash
# POSIX: running module commands from an external terminal cd PX4-Autopilot/build/px4_sitl_default/bin ./px4-commander takeoff ./px4-listener sensor_accel ./px4-param show MC_ROLLRATE_P