Embedded Linux porting Kernel Speaker: Yi-Ji Jheng Date: 2007.11.28
Outline Embedded Linux porting - Kernel
Embedded Linux porting Kernel
Target Board LAN DSP WAN Console port MIPS 8MB * 2 SDRAM 4MB FLASH
Source environment hardphone/ |-linux-2.4.17_mvl21.tar.gz |-opt.tar.gz
Install Toolchain #tar zxvf opt.tar.gz #PATH=$PATH:/usr/src/hardphone/opt/hardhat/devkit/mips/lexra_fp_be/bin #PATH=$PATH:/usr/src/hardphone/opt/tools
Make Kernel #tar zxvf linux-2.4.17_mvl21.tar.gz #cd ./linux-2.4.17_mvl21 #make clean && make mrproper #cp ./sd.config ./.config #touch ./arch/mips/ramdisk/ramdisk.gz #make menuconfig #make dep #make zImage
Download in Target Board 1. Use Winscp to get zImage on PC 2. Setup Target Board 3. Execute and setup tftp 4. Execute and setup Super Terminate 5. Load Kernel Image on Target Board 6. Run
Work Implement below pic.
replenish
Toolchain for compiler mips_lexra_fp_be-g++ mips_lexra_fp_be-cpp mips_lexra_fp_be-gcc mips_lexra_fp_be-ld mips_lexra_fp_be-as mips_lexra_fp_be-strip .
Toolchain for mkimage Add header on Kernel image to tell BootLoader some info. Header is 64 Byte (0x40) -a set load address to ''addr'' (hex) -e set entry point to ''ep'' (hex) -C set compression type 'comp'
Point to menuconfig (1/2) Target Board Machine selection ---> [*] Support for Lexra LX-PB20K board (19200) Default BAUD Rate CPU CPU selection ---> (Lexra_LX45XXX) CPU type
Point to menuconfig (2/2) Network device Network device support ---> [*] Network device support Ethernet (10 or 100Mbit) ---> [*] Ethernet (10 or 100Mbit) [*] MIPS SD9218 embedded ethernet controller support Cross compiler Kernel hacking ---> [*] Are you using a crosscompiler
Makefile Find a parameter that call CROSS_COMPILE CROSS_COMPILE = mips_lexra_fp_be-
No ramdisk.gz error make[1]: Entering directory `/usr/src/hardphone/linux-2.4.17_mvl21/arch/mips/ramdisk' make[1]: *** No rule to make target `ramdisk.gz', needed by `ramdisk.o'. Stop. make[1]: Leaving directory `/usr/src/hardphone/linux-2.4.17_mvl21/arch/mips/ramdisk' make: *** [_dir_arch/mips/ramdisk] Error 2
Kernel Image of Location arch/mips/zboot/zImage 474Byte
Setup Target Board Ethernet - LAN Console port Power
Execute and setup tftp Where does kernel image ?
Execute and Setup Super Terminate (1/3) Any name
Execute and Setup Super Terminate (2/3) Select your console port
Execute and Setup Super Terminate (3/3)
Load Kernel Image in Target Board Power on hardphone Press any key into the Boot Mode, otherwise go into Linux
Boot Mode Command ? - print this menu f - load from Flash and go l - load from TFTP server to SDRAM, no go (no save to Flash) L - load from TFTP server to SDRAM and go @ - load from TFTP server to SDRAM, no go (save to Flash) b - show boot parameters c - change boot parameters p - ping test (ping other station from the target)
Setup that Download from tftp BOOT> c tftp server 140.125.33.177 – <tftp ip> tftpfile zLinuxR.img – <kernel image name> ip address 140.125.33.253 – <target board ip> subnetmask 255.255.255.0 – <netmask> gateway 140.125.33.254 – <defauly gw> bootstate 0 - <default>
Kernel panic Be very happy to see that We don’t make ramdisk.gz, so we don’t mount file system