1 Embedded Linux porting Kernel Speaker: Yi-Ji Jheng Date: 2007.11.28

Preview:

Citation preview

1

Embedded Linux portingKernel

Speaker: Yi-Ji JhengDate: 2007.11.28

Outline

Embedded Linux porting - Kernel

2

EMBEDDED LINUX PORTINGKERNEL

3

Target Board

4

Console port

MIPS

4MB FLASH

DSP

LAN

WAN

8MB * 2 SDRAM

Source environment

hardphone/|-linux-2.4.17_mvl21.tar.gz|-opt.tar.gz

5

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

6

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

7

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

8

Work

Implement below pic.

9

REPLENISH

10

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

.

.

.

11

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'

12

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

13

Point to menuconfig (2/2)

Network device Network device support --->

[*] Network device supportEthernet (10 or 100Mbit) --->[*] Ethernet (10 or 100Mbit)[*] MIPS SD9218 embedded

ethernet controller support

Cross compiler Kernel hacking --->

[*] Are you using a crosscompiler14

Makefile

Find a parameter that call CROSS_COMPILE CROSS_COMPILE = mips_lexra_fp_be-

15

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

16

Kernel Image of Location

arch/mips/zboot/zImage 474Byte

17

Setup Target Board

18

Ethernet - LAN

Power

Console port

Execute and setup tftp

19

Where does kernel image ?

Execute and Setup Super Terminate (1/3)

20

Any name

Execute and Setup Super Terminate (2/3)

21

Select your console port

Execute and Setup Super Terminate (3/3)

22

Setup

Load Kernel Image in Target Board

Power on hardphone Press any key into the Boot Mode,

otherwise go into Linux

23

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

(no save to Flash) @ - 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)

24

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>

25

Kernel panic

Be very happy to see that We don’t make ramdisk.gz, so we

don’t mount file system

26