Lab III - Embedding Linux 1
Abstract arm linux tool-chain root NET-Start! 2
Part 1.4 Step1. tool-chain 4 Step2. PATH 4 Part 2 kernel 5 Step1. 5 Step2... 6 Step3...8 Part 3 root. 8 Step1. 8 Step2. 8 Part 4 - NET-Start!..9 Step1. minicom 9 Step2. 11 Step3. NET-Start!...11 12 3
Part 1 - NET-Start! ARM7TDMI (cross-compiler) ARM Step1. tool-chain NET-Start! tool-chain rpm : armtools-2.95.3-5.i386.rpm gnu compiler Rpm rpm (red hat package manager) root : armtools root@host:~/# rpm ivh armtools-2.95.3-5.i386.rpm xwindow Step2. PATH rpm tool-chain /usr/local/gnu-2.95.3/ bin/arm-elf-* compiler assembler linker PATH PATH root@host:~/# export PATH=$PATH:/usr/local/gnu-2.95.3/bin 4
2. Part 2 kernel NET-Start! ARM7TDMI (memory manage unit, MMU) processor linux NET-Start! uclinux MMU uclinux Step1. linux http://www.kernel.org/pub/linux/kernel ftp://linux.csie.nctu.edu.tw/kernel 2.0.38 v2.4 root@host:~/ # wget ftp://linux.csie.nctu.edu.tw/kernel/v2.0/kernel-2.0.38.tar.bz2 tarball root@host:~/ # tar jxvf kernel-2.0.38.tar.bz2 uclinux patch patch root@host:~/ # cd linux root@host:~/linux/ # zcat../patch-uclinux-arm-2.0.38.gz patch p1 uclinux 2.0.38 ARM7TDMI NET-Start! processor NET-Start! 2.0.38 patch netstart-patch root@host:~/linux/ # zcat../uclinux-netstart-2.0.x.patch.gz patch p1 5
NET-Start! Step2. linux linux root@host:~/linux-2.0.38/ # make menuconfig space or enter General Setup WISCORE NET-Start! code Networking NET-Start! 6
flat binaries uclinux ZFLAT console output Floppy, IDE, and other block devices RAM disk size Networking options TCP/IP firewall, gateway Network Device support protocol Filesystems Filesystem ramdisk Exit Yes 7
Step3. root@host:~/linux/ # make dep && make clean. root@host:~/linux/ # make linux.bin linux.bin NET-Start! Part 3 root NET-Start! flash Step1. 1Mb (minix) root@host:~/# dd if=/dev/zero of=initrd-1024 bs=1k count=1024 root@host:~/# mkfs.minix initrd-1024 Step2. 8
root@host:~/# mkdir initrd root@host:~/# mount -o loop initrd-1024 initrd root@host:~/# tar -jxvf rootfs.tar.bz2 -C initrd NET-Start! root@host:~/# umount initrd root@host:~/# gzip -9 -c initrd-1024 > initrd-1024.gz NET-Start! Part 4 - NET-Start! (linux.bin) (initrd-1024.gz) NET-Start! Step1. minicom NET-Start! (RS-232) minicom NET-Start! minicom root@host:~/# minicom -s Serial port setup 9
Serial Device COM1=/dev/ttyS0, COM2=/dev/ttyS1 Hardware/Software Flow Control No E F Q 19200 bps 8N1 10
Save setup as dfl Exit minicom Step2. SW2 OFF NET-Start! bootstrap loader rs232 minicom RUN> HELP NET-Start! flash 0x01800000 to 0x0180FFEF 0x0180FFF0 to 0x0180FFFF 0x01810000 to 0x018FFFFF 0x01900000 to 0x0197FFFF 0x01980000 to 0x019FFFFF Program and read only data space for bootloader Reserved for Ethernet Mac address NET-Start! Linux kernel image Initial ramdisk image for NET-Start! Linux kernel Unused Flash memory 0x01810000 NET-Start! Step3. NET-Start! Bootstrap loader XMODEM ram flash NET-Start! RUN> rx 0x10000 ( Crtl-A S XMODEM linux.bin linux.bin 16 ) 11
flash RUN> copy 0x10000 0xb0000 0x1810000 ( 0x10000~0xb0000 0x1810000 0x10000~0xb0000 ) initrd-1024.gz NET-Start! RUN> rx 0x10000 ( ) flash RUN> copy 0x10000 0x70000 0x18c0000 ( 0x10000~0x70000 0x18c0000) RUN> go 0x1810000 ok # flash SW2 ON bootstrap loader 0x1810000 uclinux NET-Start! uclinux NET-Start! 12