Embitude Infotech1

Embedded Linux Boot Sequence

🧠 Introduction

Every time you power on an Embedded Linux board, an incredible journey begins — one that takes your hardware from a blank state to a fully functional Linux system.

Most developers interact only with the final stage — the shell prompt — but beneath that simplicity lies a fascinating multi-stage process involving ROM Code, Bootloaders, Kernel, Root Filesystem, and Init.

In this post, let’s unpack the complete boot-up sequence using one of the most loved development boards — the BeagleBone Black.

By the end, you’ll have a crystal-clear understanding of what happens between pressing the power button and seeing your Linux login prompt.


⚙️ The Boot Flow Overview

Before diving deep, here’s the big picture:

Power On 

ROM Code

First Stage Bootloader (SPL - MLO)

U-Boot (Second Stage Bootloader)

Linux Kernel

Root Filesystem (RootFS)

Init (User Space Initialization)

Each of these stages plays a critical role in bringing your board to life.


🧩 Stage 1: ROM Code — The Invisible Starter

When you power up your BeagleBone Black, the ARM processor (AM335x) doesn’t start Linux directly.

It first executes a small piece of code — the ROM Code — that’s permanently stored inside the SoC.

🔹 What the ROM Code Does

  • Initializes basic hardware like clocks and internal RAM.
  • Detects the boot source (eMMC, SD card, UART, USB, or SPI flash).
  • Loads the First Stage Bootloader (known as SPL or MLO) into internal SRAM.
  • Verifies image integrity (if secure boot is enabled).

On BeagleBone Black, the ROM Code follows a boot priority:

  1. SD Card
  2. eMMC
  3. UART / USB (for recovery mode)

If you’ve ever held down the BOOT switch while powering on your board — you’ve overridden this sequence to force boot from SD card.


🧱 Stage 2: The First Stage Bootloader (SPL / MLO)

The Secondary Program Loader (SPL), also called MLO, is a slimmed-down version of U-Boot.
Its job is to prepare the system enough to load the full U-Boot binary into DDR memory.

🔹 What SPL Does

  • Initializes DRAM (since the ROM code can only use internal SRAM).
  • Sets up essential peripherals (like UART and MMC).
  • Loads the next-stage bootloader (U-Boot) from the detected storage.

SPL is typically stored in the first few sectors of the SD card or eMMC — often formatted as a raw binary file.

Once it finishes, SPL hands over control to U-Boot.


🏗️ Stage 3: U-Boot — The Real Boot Manager

U-Boot (Universal Bootloader) is the heart of the Embedded Linux boot process.
It provides developers with immense flexibility for managing, configuring, and debugging boot scenarios.

🔹 Key Responsibilities of U-Boot

  • Initializes remaining hardware components.
  • Loads the Linux Kernel, Device Tree (DTB), and RootFS image into memory.
  • Passes boot arguments (bootargs) to the kernel.
  • Provides an interactive boot console for customization and testing.

You can modify how your board boots by changing U-Boot environment variables like:

printenv
setenv bootcmd
setenv bootargs
saveenv

🔹 Example Boot Flow in U-Boot

bootcmd=mmc dev 0; fatload mmc 0:1 ${kernel_addr_r} zImage; fatload mmc 0:1 ${fdt_addr_r} am335x-boneblack.dtb; bootz ${kernel_addr_r} - ${fdt_addr_r}
bootargs=console=ttyO0,115200 root=/dev/mmcblk0p2 rw rootwait

U-Boot executes bootcmd after bootdelay seconds, loads the kernel and DTB, passes bootargs to the kernel, and starts booting Linux.


🐧 Stage 4: The Linux Kernel — Bringing Hardware to Life

Once U-Boot transfers control to the Linux kernel, the kernel begins initializing the system.

🔹 The Kernel’s Role

  • Decompresses itself in RAM.
  • Initializes CPU, memory, and essential drivers.
  • Mounts the Root Filesystem (RootFS) specified in bootargs.
  • Starts the first user-space process: Init.

In Embedded Linux, the kernel also reads the Device Tree Blob (DTB), which describes hardware configuration — memory maps, GPIOs, UARTs, and more.

If the kernel can’t find the root filesystem or correct DTB, the boot halts with a familiar message:

Kernel panic - not syncing: VFS: Unable to mount root fs

🧰 Stage 5: Root Filesystem — The Linux World

Once the kernel has initialized the hardware, it mounts the Root Filesystem (RootFS) — the “world” where Linux actually lives.

🔹 RootFS Includes:

  • /bin, /sbin, /lib: Core Linux utilities and libraries
  • /etc: Configuration files
  • /dev, /proc, /sys: Virtual filesystem interfaces
  • /usr, /home: Applications and user data

In BeagleBone Black, RootFS can reside on:

  • SD card partition
  • eMMC
  • NFS (Network File System)
  • RAM (initramfs)

Once RootFS is mounted, the kernel launches the init process — marking the transition to user space.

🧩 Stage 6: Init — The First User-Space Process

The init process (PID 1) is the starting point of user-space execution.
It sets up system services, mounts secondary filesystems, starts background daemons, and finally launches the shell or login manager.

On modern systems, systemd or BusyBox init handle this process.

🔹 Init Responsibilities

  • Run startup scripts from /etc/inittab or /etc/systemd/.
  • Launch network services, shells, and user applications.
  • Keep the system running until shutdown.

At this stage, your BeagleBone Black is officially alive — ready for development, networking, or application execution.

🧭 Recap: The Boot-Up Flow at a Glance

ROM Code → SPL (MLO) → U-Boot → Kernel → RootFS → Init

Each stage builds upon the previous one:

  • ROM Code initializes the SoC and finds the bootloader.
  • SPL sets up DDR and loads U-Boot.
  • U-Boot loads the Kernel + DTB + RootFS.
  • Kernel initializes drivers and mounts RootFS.
  • Init brings the user space to life.

This modular, layered design makes Embedded Linux incredibly powerful and flexible — ideal for everything from IoT boards to industrial systems.


🚀 Go Deeper with Embedded Linux Porting Hacks

If this breakdown fascinated you, take the next step with my course:
👉 Embedded Linux Essentials

This hands-on program (using BeagleBone Black) helps you:

  • Master the complete boot-up sequence
  • Configure and build the Linux Kernel & U-Boot
  • Understand Device Tree and RootFS internals
  • Recover bricked boards and optimize boot time

Join the community of Embedded Linux enthusiasts and level up your understanding of real hardware boot processes:
🌐 Embitude Community

🏷️ Related Reading

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top