1 / 17

Embedded Linux porting

Embedded Linux porting. Speaker: Yi-Ji Jheng Date: 2007.12.05. Outline. Embedded Linux porting. Embedded Linux porting. Step. Toolchain*. zImage. Kernel. File System. ramdisk.gz. busybox. Toolchain*. buildroot. Source Environment. porting/ |-filesystem |-busybox-1.1.3.tar.gz

lorie
Télécharger la présentation

Embedded Linux porting

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. Embedded Linux porting Speaker: Yi-Ji Jheng Date: 2007.12.05

  2. Outline • Embedded Linux porting

  3. Embedded Linux porting

  4. Step Toolchain* zImage Kernel File System ramdisk.gz busybox Toolchain* buildroot

  5. Source Environment • porting/ |-filesystem |-busybox-1.1.3.tar.gz |-busybox.config |-rootfs.tar.gz |-kernel |-linux-2.4.17_mvl21.tar.gz |-opt.tar.gz |-toolchain |-buildroot-0.9.27.tar.gz |-buildroot.config |-dl

  6. Make Toolchain • #tar zxvf buildroot-0.9.27.tar.gz • #cd ./buildroot • #cp ../buildroot.config ./.config • #make menuconfig • #cp -af ../dl ./. • #make • #PATH=$PATH:/usr/local/toolchain/bin

  7. Make busybox with Toolchain • #tar zxvf busybox-1.1.3.tar.gz • #cd ./busybox-1.1.3 • #cp ../busybox.config ./.config • #make menuconfig • #make • #make install • #ll ./_install/

  8. Make File System (1/2) • #cd .. • #dd if=/dev/zero of=ramdisk count=1024 bs=8192 • #mke2fs ramdisk • #mkdir /mnt/tmp • #mount -o loop ramdisk /mnt/tmp • #cp -af ./busybox-1.1.3/_install/* /mnt/tmp/.

  9. Make File System (2/2) • #tar zxvf rootfs.tar.gz • #cp -af ./rootfs/* /mnt/tmp/. • #mkdir /mnt/tmp/var • #mkdir /mnt/tmp/tmp • #mkdir /mnt/tmp/proc • #umount ramdisk • #gzip -9 ramdisk

  10. Make zImage (1/2) • #tar zxvf opt.tar.gz • #PATH=$PATH:/usr/src/porting/kernel/opt/hardhat/devkit/mips/lexra_fp_be/bin • #PATH=$PATH:/usr/src/porting/kernel/opt/tools • #tar zxvf linux-2.4.17_mvl21.tar.gz • #cd ./linux-2.4.17_mvl21

  11. Make zImage (2/2) • #cp sd.config ./.config • #make menuconfig • #make dep • #cp -af ../../filesystem/ramdisk.gz ./arch/mips/ramdisk/. • #make zImage • Download on Target Board

  12. Work • Compile a program on Target Board

  13. replenish

  14. Menuconfig • Target Architecture (mips) ---> • Build options ---> (/usr/local/toolchain) Toolchain and header file location? • Toolchain Options ---> --- Kernel Header Options Kernel Headers (Linux 2.4.27 kernel headers) ---> --- uClibc Options [ ] Use the daily snapshot of uClibc? --- Binutils Options Binutils Version (binutils 2.15.94.0.2) ---> --- Gcc Options GCC compiler Version (gcc 3.4.3) ---> [] Build/install c++ compiler and libstdc++? --- Ccache Options [ ] Enable ccache support? --- Common Toolchain Options [] Enable multilib support? [] Enable large file (files > 2 GB) support? • Package Selection for the target ---> [ ] busybox • Target Options ---> [*] ext2 root filesystem for the target device

  15. Get Method • 1. get from Internet • Must to modify website • #vi ./toolchain/gcc/gcc-uclibc-3.x.mk • GCC_SITE:=http://mirrors.usc.edu/pub/gnu/gcc/gcc-$(GCC_VERSION) • 2. perpare in advance

  16. Uclibc Question • Target Processor Architecture > 1. Generic (MIPS I) (CONFIG_MIPS_ISA_1) (NEW) 2. MIPS II (CONFIG_MIPS_ISA_2) (NEW) 3. MIPS III (CONFIG_MIPS_ISA_3) (NEW) 4. MIPS IV (CONFIG_MIPS_ISA_4) (NEW) 5. MIPS32 (CONFIG_MIPS_ISA_MIPS32) (NEW) 6. MIPS64 (CONFIG_MIPS_ISA_MIPS64) (NEW) choice[1-6?]:<Enter> • Target Processor Endianness > 1. Little Endian (ARCH_LITTLE_ENDIAN) (NEW) 2. Big Endian (ARCH_BIG_ENDIAN) (NEW) choice[1-2?]:<Enter> • Target CPU has a memory management unit (MMU) (ARCH_HAS_MMU) [Y/n/?] (NEW) <Enter>

  17. Menuconfig • Busybox Settings ---> Build Options ---> [*] Do you want to build BusyBox with a Cross Compiler? (mips-linux-) Cross Compiler prefix

More Related