Linux system porting based on FS4412 platform

Source: Internet
Author: User
Tags posix

Installation of an experimental crossover tool chain

"Experimental Purpose"

Understand the compilation process of the Cross tool chain and its use.

Description: In the experiment , the command line prompt was "$" for running on the host, "#" for running on the target board

"Experimental Environment"

1. Ubuntu 12.04 Release

2. FS4412 Platform

"Experimental Steps"

1, if you want to compile the tool chain, download the source code from the following link

Crosstools-ng

http://ymorin.is-a-geek.org/download/crosstool-ng/

At the same time there are patches for each version we try to put these patches on, these patches are

http://ymorin.is-a-geek.org/download/crosstool-ng/01-fixes/

Here we are ready for everyone to go into our tools folder.

Move the folder to our Ubuntu system and execute it.

$ CD Tools

$ sudodpkg-i *.deb

2, unzip the 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. Adding environment variables

Modify the file/ETC/BASH.BASHRC add the following:

Export path= $PATH:/home/linux/toolchain/gcc-4.6.4/bin

Restart configuration file

$ SOURCE/ETC/BASH.BASHRC

4, tool chain testing

$ 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 is ready to be installed.

Burning and using of experiment two U-boot

"Experimental Purpose"

Learn about the common commands of u-boot and the boot of the Linux kernel.

"Experimental Environment"

1. Ubuntu 12.04 Release

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 a directory sdupdate in the SD card and copy the first day/mirror u-boot-fs4412.bin to this directory

2. Burning and writing of U-boot

A) Connect serial port and board, run serial Communication program (Putty First day tool)

Select "Serial" in the upper-right corner, then click "Serial" in the lower-left corner

According to the case of your own host select COM port other must always, then click on open serial port

b) Power off the Development Board, turn the dial switch SW1 to (+) (SD boot mode)

c) Insert the SD boot disk you just made into the SD card slot

d) Re-open the Development Board to see the following interface

Press any key when counting down

E) Burn Write

Perform on the terminal

sdfuse flashall

Wait for terminal no output is to indicate burn-write end

f) Power off the board, turn the dial switch SW1 to 0110 (emmc start mode), and the following interface indicates the success of the burn write.

Press any key when counting down

3. Load the kernel and file system through the network

A) Copy the first day/image file/uimage to Ubuntu/tftpboot

b) Copy the first day/image file/rootfs.tar.xz to Ubuntu/source and unzip

c) Copy the first day/image file/exynos4412-fs4412.dtb to Ubuntu/tftpboot

d) Modify the Virtual machine NFS configuration file/etc/exports, add the following and restart the NFS service

/source/rootfs * (Rw,sync,no_subtree_check,no_root_squash)

e) Re-driving the NFS service

$ sudo/etc/init.d/nfs-kernel-server Restart

f) Set the 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 corresponding Ubuntu of the IP

192.168.9.233 corresponding to the board IP

These two IP should be modified according to their actual situation

g) Start the Development Board to see the following behavior indicates a successful network mount:

This is a command test that can enter some Linux

4. Loading the kernel and file system from eMMC

A) Copy the first day/image file/ramdisk.img Copy to the virtual machine/tftpboot directory

b) burn and write kernel image to eMMC

# TFTP 41000000 uimage

# Movi Write Kernel 41000000

c) burn and write the device tree file to eMMC

# TFTP 41000000 EXYNOS4412-FS4412.DTB

# movi Write DtB 41000000

d) Burn write file system image to eMMC

# TFTP 41000000 ramdisk.img

# movi Write Rootfs 41000000 300000

e) Set the 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 command Exercises

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

b) Edit the program source code myapp.c (write a simple C program yourself)

c) Copy to/source/rootfs after cross-compilation (add option-G at compile time)

$arm-NONE-LINUX-GNUEABI-GCC Myapp.c–o Myapp–g

$ cpmyapp/source/rootfs

D) Run our MyApp program to observe the results of the output

$./myapp

Linux system porting based on FS4412 platform

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.