Linux Boot Flow
Overview
RVComp uses fw_payload.bin as the software payload in both supported boot modes. The exact boot path depends on which bootrom mode was selected when the bitstream was built and which Buildroot configuration was used to generate the Linux image.
The two Buildroot configurations are:
uart_defconfig: builds a system that runs entirely from an initramfs in RAMmmc_defconfig: builds the same payload plus a persistentrootfs.ext4for MMC boot on Nexys 4 DDR
UART Boot
The bootrom starts in UART boot mode and waits for the payload.
The host-side serial tool sends
fw_payload.binover UART.The bootrom copies the received payload into DRAM and jumps to it.
OpenSBI starts first, then hands control to the Linux kernel.
Linux boots and mounts the initramfs embedded in
fw_payload.binas the root filesystem.The
S20-rvcomp-ethernethook runsmodprobe rvcomp_ethernetto load the Ethernet driver.
MMC Boot
fw_payload.binis written at offset 0 of the microSD card;rootfs.ext4follows at the 32 MiB offset.At power-on, the bootrom copies
fw_payload.binfrom the sdcram MMIO window into DRAM.OpenSBI starts, then launches the Linux kernel.
The minimal initramfs inside
fw_payload.binstarts first.The
S20-rvcomp-ethernethook runsmodprobe rvcomp_ethernetto load the Ethernet driver.The
S30-rvcomp-mmc-rootfshook loadsrvcomp_mmc, waits for/dev/mmcblk0, mounts the ext4 filesystem, and performsswitch_root.
Because the rvcomp-mmc driver applies rootfs-offset from the device tree, Linux accesses the root filesystem directly via /dev/mmcblk0 without a partition table.
Early-Boot Hooks
The hooks under /etc/rvcomp/initramfs.d/ are sourced in alphanumeric order by /init.
S20-rvcomp-ethernet
Loads the Ethernet driver:
modprobe rvcomp_ethernet
The network interface is brought up but has no IP address by default. To configure the network at boot, add the following lines to S20-rvcomp-ethernet:
ip addr add <IP_ADDRESS>/<PREFIX_LEN> dev eth0
ip link set eth0 up
S30-rvcomp-mmc-rootfs
Used in MMC boot only. Loads the block driver, waits for /dev/mmcblk0 to appear, mounts the ext4 root filesystem, and performs switch_root to hand off to the persistent userspace.
Filesystem Modes
Initramfs-only (UART boot)
uart_defconfig embeds the root filesystem into fw_payload.bin. Easy to boot, but filesystem changes are lost on reset or power-off.
Persistent root filesystem (MMC boot)
mmc_defconfig produces both the boot payload and a separate ext4 filesystem. Early userspace transitions from the initramfs to the persistent filesystem during boot via switch_root.
Patches
BusyBox syslogd — ctime null pointer fix
BusyBox’s syslogd calls ctime() from glibc to format log timestamps. On RVComp, ctime() can return a null pointer, causing a null pointer exception. A patch is applied to BusyBox to work around this.
The patch is located at RVComp/buildroot/patches/busybox/0001-sysklogd-use-local-timestamp-buffer.patch.
What the patch does:
The patch adds a format_local_timestamp() function and replaces all ctime() calls in sysklogd/syslogd.c with it. The new function:
Calls
localtime_r()instead ofctime()and validates its return value and all fields (tm_mon,tm_mday,tm_hour,tm_min,tm_sec).Falls back to
"Jan 1 00:00:00"iflocaltime_r()returns NULL or produces an out-of-range value.Writes the formatted timestamp into a local stack buffer (
char timestamp_buf[20]) instead of using the static buffer returned byctime().
This eliminates the null pointer dereference and makes timestamp formatting safe.