howtobuildandloadlinuxtoembeddedsystem-130902083956-phpapp01
howtobuildandloadlinuxtoembeddedsystem-130902083956-phpapp01
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)
$ make menuconfig
BuildRoot basic usage
To config linux kernel type:
$ make linux-menuconfig
$ 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