1 Embedded Linux porting Speaker: Yi-Ji Jheng Date:
Outline Embedded Linux porting 2
EMBEDDED LINUX PORTING 3
ramdisk.gz Step 4 KernelFile System busyboxToolchain* buildroot Toolchain* zImage
Source Environment porting/ |-filesystem |-busybox tar.gz |-busybox.config |-rootfs.tar.gz |-kernel |-linux _mvl21.tar.gz |-opt.tar.gz |-toolchain |-buildroot tar.gz |-buildroot.config |-dl 5
Make Toolchain #tar zxvf buildroot tar.gz #cd./buildroot #cp../buildroot.config./.config #make menuconfig #make menuconfig #cp -af../dl./. #cp -af../dl./. #make #make #PATH=$PATH:/usr/local/toolchain/bin 6
Make busybox with Toolchain #tar zxvf busybox tar.gz #cd./busybox #cp../busybox.config./.config #make menuconfig #make menuconfig #make #make install #ll./_install/ 7
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/. 8
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 9
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 _mvl21.tar.gz #cd./linux _mvl21 10
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 11
Work Compile a program on Target Board 12
REPLENISH 13
Menuconfig Target Architecture (mips) ---> Build options ---> (/usr/local/toolchain) Toolchain and header file location? Toolchain Options ---> --- Kernel Header Options Kernel Headers (Linux kernel headers) ---> --- uClibc Options [ ] Use the daily snapshot of uClibc? --- Binutils Options Binutils Version (binutils ) ---> --- 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 14
Get Method 1. get from Internet Must to modify website #vi./toolchain/gcc/gcc-uclibc-3.x.mk GCC_SITE:= u/gcc/gcc-$(GCC_VERSION) 2. perpare in advance 15
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?]: Target Processor Endianness > 1. Little Endian (ARCH_LITTLE_ENDIAN) (NEW) 2. Big Endian (ARCH_BIG_ENDIAN) (NEW) choice[1-2?]: Target CPU has a memory management unit (MMU) (ARCH_HAS_MMU) [Y/n/?] (NEW) 16
Menuconfig Busybox Settings ---> Build Options ---> [*] Do you want to build BusyBox with a Cross Compiler? (mips-linux-) Cross Compiler prefix 17