Knowledge / Electronics and Communication Engineering / Embedded Linux and single-board computers

Embedded Linux and single-board computers

Electronics and Communication Engineering (B.E./B.Tech) · Microprocessors and embedded · free study notes for exams, placements and interviews

In short

Embedded Linux is a full Linux kernel plus a minimal, purpose-built root filesystem running on a resource-constrained device rather than a desktop. It is chosen when an application needs networking, a filesystem, a display stack, multiple processes or large libraries - things a bare-metal 8051 or small ARM Cortex-M build cannot carry. Single-board computers (SBCs) such as the Raspberry Pi, BeagleBone Black and India's own boards are complete computers on one PCB and are the standard teaching and prototyping platform for it. University syllabi examine the boot sequence, cross-compilation toolchain, device tree, build systems (Yocto/Buildroot) and GPIO/driver access; placement rounds at Bosch, Tata Elxsi, L&T Technology Services, HCLTech, Qualcomm, Texas Instruments India, KPIT, ISRO/DRDO labs and C-DAC ask these as standard screening questions.

Explained

Why Linux on an embedded device, and when not to

Software stack, layer by layer

  1. Boot ROM inside the SoC: fixed, mask-programmed code; reads boot-mode pins/eFuses and loads a small first-stage loader from SD, eMMC, NAND, SPI flash, USB or Ethernet.
  2. First-stage loader / SPL (MLO): initialises DDR controller, clocks and a minimum of pin muxing, then loads the full bootloader. (On the Raspberry Pi this role is taken by the VideoCore GPU firmware - bootcode.bin/start.elf on older models, SPI EEPROM on Pi 4/5.)
  3. Bootloader - U-Boot (most common; alternatives: barebox, GRUB/EFI on x86 SBCs): brings up console, storage and network, loads the kernel image (zImage/Image/uImage), the device tree blob and optionally an initramfs, then jumps to the kernel passing a kernel command line. Useful U-Boot commands: printenv, setenv, saveenv, tftpboot, fatload mmc 0:1 0x82000000 zImage, bootz.
  4. Linux kernel: decompresses, parses the device tree, probes drivers, mounts the root filesystem given by root=/dev/mmcblk0p2.
  5. init: PID 1 - systemd (most distributions), SysV init scripts, or BusyBox init with /etc/inittab on small systems. It mounts /proc, /sys, /dev (devtmpfs + udev/mdev), brings up networking and starts the application service.
  6. Root filesystem: /bin /sbin /lib /etc /dev /proc /sys /var /tmp /home /opt. BusyBox provides hundreds of shell utilities as one multi-call binary (symlinks point to it).
  7. Kernel command line example: console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait rw rootfstype=ext4 quiet.

Device tree, drivers and user-space hardware access

Cross-development: toolchain, build systems, debugging

Real time, storage, power and reliability

Popular SBCs and how they are used in the lab

Key points

Formulas and examples

Image/footprint sizing: total flash = bootloader + kernel + DTB + rootfs + data partition + (second slot, if A/B)
Boot time T_boot = t_ROM + t_SPL + t_U-Boot + t_kernel + t_init + t_app (sum of measured stages, seconds)
SD/eMMC transfer time t = bytes / sustained throughput (B ÷ B·s⁻¹ = s)
Flash wear: write-amplified lifetime ≈ (capacity × P/E cycles) / (daily write bytes × WAF) days; WAF = write amplification factor (dimensionless)
Baud rate to byte rate: bytes/s = baud / bits-per-frame (8N1 → 10 bits per byte, so 115200 baud ≈ 11,520 B/s)
Serial latency per byte at 8N1 = 10 / baud seconds
CPU load of a periodic task: U = C / T, C = execution time, T = period; the task is feasible only if ΣU ≤ 1 (and worst-case latency ≪ T)
I2C sensor sample rate limit ≈ bus clock / (bits per transaction), bits ≈ 9 × (bytes + address bytes) including ACKs
GPIO power: I = (V_supply − V_f) / R, series resistor R in Ω, LED forward drop V_f in V

1. A/B update partition budget on a 4 GB eMMC

2. Boot-time budget

StageStock image (s)Tuned (s)
Boot ROM + SPL0.250.25
U-Boot (3 s autoboot delay)3.200.20
Kernel (full config, initramfs)4.501.10
systemd to multi-user18.000.90
Application start2.000.35
Total27.952.80

3. SD-card wear on a logging device

4. Can a user-space loop read a sensor at 1 kHz?

5. Console throughput check

Bare metal / RTOS on MCUEmbedded Linux on SBC/SoC
HardwareCortex-M, no MMU, kB of RAMCortex-A with MMU, MB-GB of RAM
Boot timeµs-ms1-30 s
DeterminismHard real-time, µsSoft; tens of µs with PREEMPT_RT
Networking/filesystemAdded as libraries, limitedFull TCP/IP, TLS, ext4, USB, Wi-Fi
DevelopmentSingle binary, JTAG debugToolchain + rootfs + kernel + userland
PowerµA sleep modesmA to W; suspend is harder
Unit cost₹50-₹500 class₹1,500-₹10,000 class
Typical useMotor control, metering, sensingGateway, HMI, camera, edge AI
BuildrootYocto / OpenEmbeddedDebian-based image
Configurationmake menuconfig, Kconfiglayers + .bb recipes, bitbakeready image + apt
Outputkernel + rootfs imagedistribution + SDK + package feedgeneral-purpose distro
Build time (first)tens of minuteshoursminutes
Package manager on targetnone by defaultopkg/rpm/debapt
Best forfixed-function devices, teachingproducts, long-lived product linesprototypes, fastest start

Where it is used

Interview questions

Common mistakes

Related topics

Open in the Knowledge reader →Find jobs →