U-boot and usage of Linux system porting __linux

Source: Internet
Author: User
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 42000000 Exynos4412-fs4412.dtb\;bootm 41000000-42000000

#setenv Bootargs root=/dev/nfs nfsroot=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 DTB 42000000\;movi read rootfs 43000000 300000\;bootm 41000000 43000 000 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 42000000 Exynos4412-fs4412.dtb\;bootm 41000000-42000000

#setenv Bootargs root=/dev/nfs nfsroot=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

$ CP Myapp/source/rootfs

D copy Gdbserver to/source/rootfs/bin (Gdbserver is found in the cross tool chain, the path is:/home/linux/toolchain/gcc-4.6.4/ Arm-arm1176jzfssf-linux-gnueabi/debug-root/bin)

e) Run as follows on the Development Board

# Gdbserver 192.168.9.233:12345 MyApp &

f) running the Cross debugger on the host

$ arm-none-linux-gnueabi-gdb MyApp

g) Establish a connection with the Development Board Gdbserver under the Cross debugger

(GDB) Target remote 192.168.9.233:12345

Set breakpoints, enter command C to start debugging program (note the serial output)

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.