1 / 16

Building Embedded Linux System

Building Embedded Linux System. 2005/09/21 Reporter: sih-han wang. StrongARM. 32-bit StrongARM RISC processor 執行速度 : max 206 MHz. Bootloader Kernel Root Filesystem. Target. Cross-platform Development Environment. Host. 連結式規劃.

juliavargas
Download Presentation

Building Embedded Linux System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. Bootloader • Kernel • Root Filesystem Target Cross-platform Development Environment Host 連結式規劃

  4. 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

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

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

  7. Kernel Compiling • make cleanmake 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-

  8. Make Root Filesystem Filesystem: Busybox Device node Configuration

  9. 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

  10. 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

  11. 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

  12. 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.

  13. 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.img > initrd.bin 8MBfile is null mount ~/root-fs Write DATA 8MBfile with data unmount

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

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

More Related