Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building Embedded Linux System 2005/09/21 Reporter: sih-han wang.

Similar presentations


Presentation on theme: "Building Embedded Linux System 2005/09/21 Reporter: sih-han wang."— Presentation transcript:

1 Building Embedded Linux System 2005/09/21 Reporter: sih-han wang

2 StrongARM  32-bit StrongARM RISC processor  執行速度 : max 206 MHz

3 連結式規劃 Cross-platform Development Environment Host Bootloader Kernel Root Filesystem Target

4

5 There are four main steps to creating a target Linux system Determine system components Configure and build the kernel Build root filesystem Set up boot software and configuration

6 Make Kernel 使用 Linux kernel 需要 Linux kernel source + some patches if needed cross-compiler

7 Kernel Configuration  make config 這種模式需要逐行輸入所需要設定的項目,無法往前 修改設定,所以目前很少使用這種方式來設定 Kernel 的項目了  make xconfig 這種模式則是使用 X-Window 為主要環境的設定模 式!除非你有 X-Window 在執行,否則沒有辦法使 用這種模式;  make menuconfig----  Makefile 這種模式有點像是文字界面的選單模式,較為簡便, 而且可以在純文字界面下面執行編輯動作!

8 Kernel Compiling make clean make menuconfig ( gzip – dc /home/ patch-2.4.18-rmk7.gz | patch – p1 – d arm-linux gzip – dc /home/ diff-2.4.18-rmk7-pxa3.gz | patch – p1 – d arm-linux) make assabet_config make oldconfig make dep make zImage Additional Options: ARCH=arm CROSS_COMPILE=arm-linux-

9 Make Root Filesystem Filesystem: Busybox Device node Configuration

10 BusyBox  Combine tiny versions of many common UNIX into a single small executable.  Provide a fairly complete environment for any small or embedded system.  BusyBox has been written with size- optimization and limited resources in mind. It is also extremely modular so you can easily include or exclude commands (or features) at compile time. This makes it easy to customize your embedded systems  Ex: ls dd cp cat tar chmod mknod find ps

11 Make Busybox  make menuconfig  ln –s /home/arm- linux/include/linux/version.h version.h (/usr/local/arm/2.95.3/arm- linux/include/linux)  make  make PREFIX=../busybox_arm install

12 Device Files 檔名 類型 主編號 次編號 權限  mknod console c 5 1 600  mknod tty0 c 5 0 600  mknod mem c 1 1 600  mknod null c 1 3 666  mknod random c 1 8 644

13 initrd  initrd provides the capability to load a RAM disk by the boot loader.  This RAM disk can then be mounted as the root file system and programs can be run from it.  Afterwards, a new root file system can be mounted from a different device. The previous root (from initrd) is then moved to a directory and can be subsequently unmounted.  initrd is mainly designed to allow system startup to occur in two phases, where the kernel comes up with a minimum set of compiled-in drivers, and where additional modules are loaded from initrd.

14 Make INITRD image dd if=/dev/zero of=/home/initrd.img bs=1k count=8192 su root mke2fs -F -v -m0 /home/initrd.img mkdir tmp mount -o loop initrd.img tmp/ cp ~/root-fs/* /home/tmp/ -dpRrf umount tmp/ gzip -9 initrd.bin 8MB file is null ~/root-fs mount Write DATA 8MB file with data unmount

15 Write Shell Script  / etc/inittab ::sysinit:/etc/rc.S ::askfirst:/bin/sh  /etc/rc.S #!/bin/sh mount -t proc proc /proc

16 Cross-Compiler X86 Architecture code ARM(Advanced RISC Machine) execution -----------------------------  Cross-Compiler 在 /etc/bashrc 中加入 PATH=$PATH:/usr/local/arm/2.95.3/bin Next


Download ppt "Building Embedded Linux System 2005/09/21 Reporter: sih-han wang."

Similar presentations


Ads by Google