experiment with the installation of a cross tool chain
"Experimental Purposes"
Understand the compilation process of the Cross tool chain and its use.
Note: In the experiment , the command line prompt "$" indicates running on the host, and "#" means running on the target board .
"Experimental Environment"
1, Ubuntu 12.04 release version
2, FS4412 Platform
"Experimental Steps"
1, if you want to compile the tool chain, download the source from the link below
Crosstools-ng Download Address
http://ymorin.is-a-geek.org/download/crosstool-ng/
At the same time for each version has a corresponding patch we try to put these patches on, the download address of these patches is
http://ymorin.is-a-geek.org/download/crosstool-ng/01-fixes/
Here we are ready for everyone in advance, and we are going to go into our tools folder.
Move the folder to our Ubuntu system and execute it.
$ CD Tools
$ sudodpkg-i *.deb
2, decompression tool chain compression package
$ cd ~
$ mkdir Toolchain
$ CD Toolchain
Copy the first day/tool/GCC-4.6.4.TAR.XZ to the Toolchain directory and unzip
$ tar xvf gcc-4.6.4.tar.xz
3, the environment variable add
Modify file/ETC/BASH.BASHRC Add the following
Export path= $PATH:/home/linux/toolchain/gcc-4.6.4/bin
Restart the configuration file
$ SOURCE/ETC/BASH.BASHRC
4, the tool chain test
$ arm-none-linux-gnueabi-gcc–v
Using built-in specs.
collect_gcc=arm-none-linux-gnueabi-gcc
collect_lto_wrapper=/home/david/exynos4412/toolchain/gcc-4.6.4/bin/.. /libexec/gcc/arm-arm1176jzfssf-linux-gnueabi/4.6.4/lto-wrapper
Target:arm-arm1176jzfssf-linux-gnueabi
Configured with:/work/builddir/src/gcc-4.6.4/configure--build=i686-build_pc-linux-gnu--host=i686-build_ pc-linux-gnu--target=arm-arm1176jzfssf-linux-gnueabi--prefix=/opt/tuxamitosofttoolchains/ arm-arm1176jzfssf-linux-gnueabi/gcc-4.6.4--with-sysroot=/opt/tuxamitosofttoolchains/ Arm-arm1176jzfssf-linux-gnueabi/gcc-4.6.4/arm-arm1176jzfssf-linux-gnueabi/sysroot--enable-languages=c,c++-- With-arch=armv6zk--with-cpu=arm1176jzf-s--with-tune=arm1176jzf-s--WITH-FPU=VFP--with-float= softfp--with-pkgversion= ' Crosstool-ng hg+default-2685dfa9de14-tc0002 '--disable-sjlj-exceptions--enable-__cxa_ Atexit--disable-libmudflap--disable-libgomp--DISABLE-LIBSSP--disable-libquadmath--disable-libquadmath-support- -with-gmp=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools--with-mpfr=/work/builddir/ arm-arm1176jzfssf-linux-gnueabi/buildtools--with-mpc=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/ Buildtools--with-ppl=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools--with-cloog=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools--with-libelf=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/ buildtools--with-host-libstdcxx= '-STATIC-LIBGCC-WL,-BSTATIC,-LSTDC++,-BDYNAMIC-LM '--enable-threads=posix-- Enable-target-optspace--without-long-double-128--disable-nls--disable-multilib--with-local-prefix=/opt/ tuxamitosofttoolchains/arm-arm1176jzfssf-linux-gnueabi/gcc-4.6.4/arm-arm1176jzfssf-linux-gnueabi/ Sysroot--enable-c99--enable-long-long
Thread Model:posix
GCC version 4.6.4 (crosstool-ng hg+default-2685dfa9de14-tc0002)
So our cross tool chain installs the U-boot and use of experiment two .
"Experimental Purposes"
Learn about U-boot's common commands and the boot of the Linux kernel.
"Experimental Environment"
1, Ubuntu 12.04 release version
2, u-boot-2010.03
3, FS4412 Platform
4, Cross compiler ARM-NONE-LINUX-GNUEABI-GCC
"Experimental Steps"
1, SD boot disk production
A) Copy the first day/tool/sd_fusing to Linux
b Insert the SD card into the computer and identify
c) Enter Sdfuse_d to perform the following actions
$ sudo./mkuboot.sh/dev/sdb
D Create the directory sdupdate in the SD card and copy the U-boot-fs4412.bin from the first day/mirror to this directory
2, u-boot of burning write
A) Connect serial port and board, run serial Communication program (Putty First day tool)
Select "Serial" in the upper-right corner and click "Serial" in the lower-left corner.
According to the situation of your own host select COM port other must have been, and then click Open to open the serial port
b) Power off the Development Board, turn the dial switch SW1 to (1000) (SD boot mode) and power on
(c) Insert the SD boot disk just done into the SD card slot
D re-open the Development Board to see the following interface
Press any key at Countdown
e) Burning writing
Executing on the terminal
Sdfuse Flashall
Wait for the terminal no output is to indicate that the burn write is over
f) Power off the Development Board, the dial Switch SW1 to 0110 (eMMC boot mode) after the power can be seen as the following interface indicates that the success of burning write
Press any key at Countdown
3. Load kernel and file system through Network
A) Copy the first day/mirror file/uimage to the Ubuntu/tftpboot
b) Copy the first day/mirror file/rootfs.tar.xz to the Ubuntu/source and unzip
C Copy the first day/mirror file/exynos4412-fs4412.dtb to the Ubuntu/tftpboot
D Modify the Virtual machine NFS Profile/etc/exports, add the following and restart the NFS service
/source/rootfs * (Rw,sync,no_subtree_check,no_root_squash)
e) Re-drive NFS Services
$ sudo/etc/init.d/nfs-kernel-server Restart
f) Set Startup parameters
# setenv ServerIP 192.168.9.120
# setenv IPAddr 192.168.9.233
# setenv Bootcmd tftp 41000000 uimage\;tftp 42000000exynos4412-fs4412.dtb\;bootm 41000000-42000000
#setenv bootargs root=/dev/nfsnfsroot=192.168.9.120:/source/rootfs rw console=ttysac2,115200 init=/linuxrc ip= 192.168.9.233
# saveenv
Note: 192.168.9.120 corresponds to ubuntu IP
192.168.9.233 IP of the corresponding board
These two IP should be modified according to their actual situation properly
g) Start the Development Board see the following behavior to successfully mount through the network:
This is a command test that you can enter some Linux
4. Load kernel and file system from eMMC
A) copy of the first day/mirror file/ramdisk.img Copy to the virtual machine/tftpboot directory
b burning the kernel image onto the eMMC
# TFTP 41000000 uimage
# Movi Write Kernel 41000000
c) Burning the device tree file to the eMMC
# TFTP 41000000 EXYNOS4412-FS4412.DTB
# movi Write DtB 41000000
d) Burning the file system mirroring to the EMMC
# TFTP 41000000 ramdisk.img
# movi Write Rootfs 41000000 300000
e) Set Startup parameters
# setenv bootcmd movi read kernel 41000000\;movi read dtb42000000\;movi read rootfs 43000000 300000\;bootm 41000000 430000 00 42000000
# saveenv
f) Restart the Development Board, U-boot automatically load, execute the kernel
5. Other Order Practice
6, cross-compilation and cross-debugging
A) Modify the U-boot startup parameter to network boot
# setenv ServerIP 192.168.9.120
# setenv IPAddr 192.168.9.233
# setenv Bootcmd tftp 41000000 uimage\;tftp 42000000exynos4412-fs4412.dtb\;bootm 41000000-42000000
#setenv bootargs root=/dev/nfsnfsroot=192.168.9.120:/source/rootfs rw console=ttysac2,115200 init=/linuxrc ip= 192.168.9.233
# saveenv
Note: 192.168.9.120 corresponds to ubuntu IP
192.168.9.233 IP of the corresponding board
These two IP should be modified according to their actual situation properly
b) Editor source code myapp.c (write a simple C program yourself)
c) replicated to/source/rootfs after compilation (add option at compile-g)
$arm-NONE-LINUX-GNUEABI-GCC Myapp.c–o Myapp–g
$ cpmyapp/source/rootfs
D Run our MyApp program and observe the output
$./myapp