SlideShare a Scribd company logo
HOW TO BUILD AND LOAD LINUX ON
EMBEDDED SYSTEM
Linux Booting Process on Embedded Board
Linux load process can be divided on next stages:
1.BootRoom is internal loader of BootStrap from ROM
flash (NandFlash or SD card)
2.BootStrap (X-Loader in case BeagleBoard) –
initializes eternal RAM and loads to it U-Boot from SD
card fist FAT partition
3.BootLoader (U-Boot) – loads kernel and provides
boot arguments
4.Kernel mount Root FS
5. Kernel start Init proccess
BootStrap (X-Loader)
X-Loader is 2nd stage bootstrap loader loaded by OMAP3
BootRom from NAND flash to internal RAM to start 3rd
stage tool like U-Boot.
Bootstrap is usually limited by internal RAM size and has
serial console to manage update of BootLoader (U-Boot).
X-loader can be updated from SD card to NAND

Must have 255 heads and 63 sectors/track

First partition is FAT and bootable

Must have “MLO” file of X-Loader.bin
For detail instruction how format SD card please refer to
https://code.google.com/p/beagleboard/wiki/LinuxBoot
DiskFormat
BootLoader (U-Boot)
Universal Bootloader is an open source, primary boot loader
used in embedded devices to start linux kernel.
X-Loader uploads U-Boot to external RAM (SDRAM or DDR)
from NAND flash or SD card.
U-Boot is responsible for next actions

Implement FAT file system and TCP/IP stack.

Load kernel image from SD card first FAT partition to ext
RAM (in case BeagleBoard at address 0x80300000)

Manage bootargs and bootcmd and provide it for kernel
U-Boot how to manage bootargs and
bootcmd
To manage U-Boot used one of the next serial ports

/dev/ttyS0

/dev/ttyUSB0
As console terminal can be used for Linux “Minicom” and for
Windows “PuTTY”. The serial port settings is 115200 8N1,
no flow control.
Environment settings bootargs and bootcmd managed by
next U-boot commands

printenv (lists all env vars)

seteenv (saves variables to flash for next boot)

bootargs (lists all kernel arguments)

bootcmd (default boot command)
U-Boot how to manage bootargs and
bootcmd
To set up kernel argument used next string:
setenv bootargs 'console=ttyS0,115200n8
root=/dev/mmcblk0p2 rootfstype=ext2 rw'
Here you can see next arguments:
1) console kernel settings 115200n8 and ttyS0
(can be ttyS2 in case console on ext screen)
2) Root fs mount path to SD card
/dev/mmcblk0p2, filetype ext2 (can be ext3)
privileges read and write
U-Boot how to manage bootargs and
bootcmd
To set up boot command used next string:
setenv bootcmd 'mmcinit; fatload mmc 0
0x80300000 uImage; bootm 0x80300000'
String above contain next boot commands:

Init mmc (also work for SD) card

Load kernel image file “uImage” from mmc (SD)
card partition 0 to memory at address
0x80300000

Boot application image from address
0x80300000
BuildRoot
BuildRoot is an embedded Linux build system
Its goal is to build

a cross-compiling toolchain

a root file-system with multiple cross-compiled libraries and
applications

a kernel image and bootloader images
or any combination of these

It has a menuconfig configuration mechanism, identical to the one

used in the kernel

It is completely written in make

It builds only what's necessary. A base system, containing just
Busybox, takes less than 2 minutes to be built from scratch.
BusyBox combines tiny versions of many common UNIX utilities into
a single small executable. It provides replacements for most of the
utilities you usually find in GNU fileutils, shellutils, etc.
BuildRoot basic usage
To tune buildroot use next command:
$ make menuconfig
BuildRoot basic usage
To config linux kernel type:
$ make linux-menuconfig
To build all run simple command:
$ make
...
Here You will be involved to install all necessary libs and
tools
...
$ ls output/images/
dataflash_at91sam9m10g45ek.bin rootfs.tar
rootfs.ubi rootfs.ubifs
u-boot.bin u-boot-env.bin
uImage
BuildRoot how does it work

Configuration options defined in Config.in files, and
stored in a .config file

Buildroot starts with the toolchain: either it generates it,
or imports an existing toolchain for instance
CodeSourcery ARM GNU/Linux tool chain

It creates a basic root filesystem from a skeleton (just a
few conguration files)

Once the toolchain is ready, Buildroot goes through the
list of selected packages. It simply fetches, configures,
builds and installs all packages, respecting their
dependencies.

It builds the kernel image and/or bootloader images, if
requested

It creates root file system images
BuildRoot source code organization

board/
contains hardware-specific and project-specific files.

boot/
contains config options and recipes for various
bootloaders

configs/
the default congurations

docs/
some documentation.

fs/
contains config options and makefiles to generate the
various filesystem images (j
s2, ubifs, ext2, iso9660, initramfs, tar and more). Also
contains the root file system skeleton
BuildRoot source code organization

linux/
contains the config options and makefile to generate the
Linux kernel

package/
contains the config options and makefiles for all
userspace packages

support/
various misc stuff
needed for the build (kcong code, etc.)

target/
mostly historic directory. No longer contains anything
useful

toolchain/
config options and makefiles to build or import the
toolchain
BuildRoot output generated source and
images

output/build/
a directory with one sub-directory per component build.
The directory contains the source of that component and
this is where it is built.

output/host/
a directory that contains the utilities built for the host
machine, including the toolchain

output/target/ the target root file system

output/images/ where final images are stored
How to build and load linux to embedded system
How to build and load linux to embedded system

More Related Content

ODP
Description of GRUB 2
PPT
PPT
101 1.1 hardware settings
PDF
Understanding The Boot Process
PDF
Grub2 Booting Process
ODP
Basics of boot-loader
ODP
5. boot process
PDF
Free bsd visually
Description of GRUB 2
101 1.1 hardware settings
Understanding The Boot Process
Grub2 Booting Process
Basics of boot-loader
5. boot process
Free bsd visually

What's hot (20)

PPTX
Linux booting sequence
PPT
Linux Booting Steps
PPTX
System Booting Process overview
PPT
101 2.2 install boot manager
PDF
Boot process: BIOS vs UEFI
ODP
Making your own bootloader
PPT
Bootstrap process of u boot (NDS32 RISC CPU)
PPTX
Bootloader and bootloading
DOCX
6 stages of linux boot process
PPT
Booting
PPTX
Linux boot process
PPT
[DEFCON 16] Bypassing pre-boot authentication passwords by instrumenting the...
PPTX
BOOTABLE OPERATING SYSTEM PPT
PPT
Unix fundamentals
PDF
Booting & shut down,
ODP
Linux boot process
PDF
Linux booting procedure
PPT
101 1.2 boot the system
PPT
Linux booting procedure
PPT
Linux installation and booting process
Linux booting sequence
Linux Booting Steps
System Booting Process overview
101 2.2 install boot manager
Boot process: BIOS vs UEFI
Making your own bootloader
Bootstrap process of u boot (NDS32 RISC CPU)
Bootloader and bootloading
6 stages of linux boot process
Booting
Linux boot process
[DEFCON 16] Bypassing pre-boot authentication passwords by instrumenting the...
BOOTABLE OPERATING SYSTEM PPT
Unix fundamentals
Booting & shut down,
Linux boot process
Linux booting procedure
101 1.2 boot the system
Linux booting procedure
Linux installation and booting process
Ad

Viewers also liked (15)

PDF
Real Estate Stats for 2013 - Boulder County
PPTX
"Personal Branding"_By_ Saddam_Rahmani
PPTX
ESL: Coraline
PPTX
Digital strategy
PDF
E commerce? It' fashion - Chibimart Fiera Milano
PPTX
Diagrama de espina o pescado ishikawa
PPTX
Digital strategy
PDF
Ideolo - Snapshot su iBeacon e opportunità
PPTX
Showrooming, webrooming and outshopping: How to address these new consumer b...
PPT
Introduction to embedded systems
PDF
Shopper Showrooming: Retailer Strategies in a Smartphone World
PDF
Come gli smartphone stanno cambiando le imprese
PDF
Le vrai impact du showrooming sur les ventes en magasin selon Ipsos
PDF
Digital strategy
PDF
GIN TONIC SHOP - Jennifer Menten, Zaakvoerder
Real Estate Stats for 2013 - Boulder County
"Personal Branding"_By_ Saddam_Rahmani
ESL: Coraline
Digital strategy
E commerce? It' fashion - Chibimart Fiera Milano
Diagrama de espina o pescado ishikawa
Digital strategy
Ideolo - Snapshot su iBeacon e opportunità
Showrooming, webrooming and outshopping: How to address these new consumer b...
Introduction to embedded systems
Shopper Showrooming: Retailer Strategies in a Smartphone World
Come gli smartphone stanno cambiando le imprese
Le vrai impact du showrooming sur les ventes en magasin selon Ipsos
Digital strategy
GIN TONIC SHOP - Jennifer Menten, Zaakvoerder
Ad

Similar to How to build and load linux to embedded system (20)

PPTX
U-Boot Porting on New Hardware
PPTX
Bootloaders (U-Boot)
PPT
U Boot or Universal Bootloader
PPTX
An Insight into the Linux Booting Process
PPT
Linux Booting Process
PPTX
Linux startup
PDF
U-Boot - An universal bootloader
ODP
Grub and dracut ii
PDF
Launch the First Process in Linux System
DOC
6 stages of linux boot process
PDF
Beagleboard xm-setup
PDF
Linux boot process – explained
PPT
Linux Booting Procedure system and networking.ppt
PPTX
introduction to computer Linux essential.pptx
PDF
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
PPTX
Linux booting process - Linux System Administration
PDF
Character_device_driver_bbb
PPT
Ch04 system administration
PDF
Embedded_Linux_Booting
U-Boot Porting on New Hardware
Bootloaders (U-Boot)
U Boot or Universal Bootloader
An Insight into the Linux Booting Process
Linux Booting Process
Linux startup
U-Boot - An universal bootloader
Grub and dracut ii
Launch the First Process in Linux System
6 stages of linux boot process
Beagleboard xm-setup
Linux boot process – explained
Linux Booting Procedure system and networking.ppt
introduction to computer Linux essential.pptx
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Linux booting process - Linux System Administration
Character_device_driver_bbb
Ch04 system administration
Embedded_Linux_Booting

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Programs and apps: productivity, graphics, security and other tools
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
Understanding_Digital_Forensics_Presentation.pptx
Spectroscopy.pptx food analysis technology
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Digital-Transformation-Roadmap-for-Companies.pptx
cuic standard and advanced reporting.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Programs and apps: productivity, graphics, security and other tools

How to build and load linux to embedded system

  • 1. HOW TO BUILD AND LOAD LINUX ON EMBEDDED SYSTEM
  • 2. Linux Booting Process on Embedded Board Linux load process can be divided on next stages: 1.BootRoom is internal loader of BootStrap from ROM flash (NandFlash or SD card) 2.BootStrap (X-Loader in case BeagleBoard) – initializes eternal RAM and loads to it U-Boot from SD card fist FAT partition 3.BootLoader (U-Boot) – loads kernel and provides boot arguments 4.Kernel mount Root FS 5. Kernel start Init proccess
  • 3. BootStrap (X-Loader) X-Loader is 2nd stage bootstrap loader loaded by OMAP3 BootRom from NAND flash to internal RAM to start 3rd stage tool like U-Boot. Bootstrap is usually limited by internal RAM size and has serial console to manage update of BootLoader (U-Boot). X-loader can be updated from SD card to NAND  Must have 255 heads and 63 sectors/track  First partition is FAT and bootable  Must have “MLO” file of X-Loader.bin For detail instruction how format SD card please refer to https://code.google.com/p/beagleboard/wiki/LinuxBoot DiskFormat
  • 4. BootLoader (U-Boot) Universal Bootloader is an open source, primary boot loader used in embedded devices to start linux kernel. X-Loader uploads U-Boot to external RAM (SDRAM or DDR) from NAND flash or SD card. U-Boot is responsible for next actions  Implement FAT file system and TCP/IP stack.  Load kernel image from SD card first FAT partition to ext RAM (in case BeagleBoard at address 0x80300000)  Manage bootargs and bootcmd and provide it for kernel
  • 5. U-Boot how to manage bootargs and bootcmd To manage U-Boot used one of the next serial ports  /dev/ttyS0  /dev/ttyUSB0 As console terminal can be used for Linux “Minicom” and for Windows “PuTTY”. The serial port settings is 115200 8N1, no flow control. Environment settings bootargs and bootcmd managed by next U-boot commands  printenv (lists all env vars)  seteenv (saves variables to flash for next boot)  bootargs (lists all kernel arguments)  bootcmd (default boot command)
  • 6. U-Boot how to manage bootargs and bootcmd To set up kernel argument used next string: setenv bootargs 'console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootfstype=ext2 rw' Here you can see next arguments: 1) console kernel settings 115200n8 and ttyS0 (can be ttyS2 in case console on ext screen) 2) Root fs mount path to SD card /dev/mmcblk0p2, filetype ext2 (can be ext3) privileges read and write
  • 7. U-Boot how to manage bootargs and bootcmd To set up boot command used next string: setenv bootcmd 'mmcinit; fatload mmc 0 0x80300000 uImage; bootm 0x80300000' String above contain next boot commands:  Init mmc (also work for SD) card  Load kernel image file “uImage” from mmc (SD) card partition 0 to memory at address 0x80300000  Boot application image from address 0x80300000
  • 8. BuildRoot BuildRoot is an embedded Linux build system Its goal is to build  a cross-compiling toolchain  a root file-system with multiple cross-compiled libraries and applications  a kernel image and bootloader images or any combination of these  It has a menuconfig configuration mechanism, identical to the one  used in the kernel  It is completely written in make  It builds only what's necessary. A base system, containing just Busybox, takes less than 2 minutes to be built from scratch. BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc.
  • 9. BuildRoot basic usage To tune buildroot use next command: $ make menuconfig
  • 10. BuildRoot basic usage To config linux kernel type: $ make linux-menuconfig To build all run simple command: $ make ... Here You will be involved to install all necessary libs and tools ... $ ls output/images/ dataflash_at91sam9m10g45ek.bin rootfs.tar rootfs.ubi rootfs.ubifs u-boot.bin u-boot-env.bin uImage
  • 11. BuildRoot how does it work  Configuration options defined in Config.in files, and stored in a .config file  Buildroot starts with the toolchain: either it generates it, or imports an existing toolchain for instance CodeSourcery ARM GNU/Linux tool chain  It creates a basic root filesystem from a skeleton (just a few conguration files)  Once the toolchain is ready, Buildroot goes through the list of selected packages. It simply fetches, configures, builds and installs all packages, respecting their dependencies.  It builds the kernel image and/or bootloader images, if requested  It creates root file system images
  • 12. BuildRoot source code organization  board/ contains hardware-specific and project-specific files.  boot/ contains config options and recipes for various bootloaders  configs/ the default congurations  docs/ some documentation.  fs/ contains config options and makefiles to generate the various filesystem images (j s2, ubifs, ext2, iso9660, initramfs, tar and more). Also contains the root file system skeleton
  • 13. BuildRoot source code organization  linux/ contains the config options and makefile to generate the Linux kernel  package/ contains the config options and makefiles for all userspace packages  support/ various misc stuff needed for the build (kcong code, etc.)  target/ mostly historic directory. No longer contains anything useful  toolchain/ config options and makefiles to build or import the toolchain
  • 14. BuildRoot output generated source and images  output/build/ a directory with one sub-directory per component build. The directory contains the source of that component and this is where it is built.  output/host/ a directory that contains the utilities built for the host machine, including the toolchain  output/target/ the target root file system  output/images/ where final images are stored