Translated Powerpoint

From ASULUG AirPanel Wiki

Revision as of 21:49, 9 February 2009 by 149.169.115.37 (Talk)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

AKA embedded series of thematic interest groups Assabet/Sa1110 development board Embedded Linux transplantation Introduction

0 directory

 A brief description
 Prepare cross-compiler tools
 Compiler redboot
 Burning redboot
 Use redboot
 Loading and the implementation of kernel
 Load and run the file system

Contents

Overview

1.1 Copyright Statement
1.2 Style Description
1.3 assabet / sa1110
1.4 ecos / redboot
1.5 Common terminology

1.1 Copyright Statement

Source from the opensource community, can use google search. Therefore, no detailed provenance marked. Copyright belongs to original author. Alan Yao from this document for the preparation of AKA embedded group, shall not be used for commercial purposes. Specific Assabet development board from the base of educational software products in the SPC. Reproduced in this document, shall be without prejudice to the company's commercial interests.

1.2 Style Description

In this paper, the source mentioned in this document are on the same directory. Version referred to basically ensure that the only version available does not mean that updates or older version is available. Description of this document are in the same directory information as the basis, and this storage directory is: /opt/orig After extracting all the source code are on the /opt/src # to represent the root user % to represent the general user

1.3 assabet / sa1110

Intel's StrongARM 1110 (SA-1110) is a general-purpose RISC microprocessors, arm architecture. 16KB instruction Cache, 8KB Data Cache, a 512B Small Cache, a write buffer, a read buffer, a memory management unit (MMU) integrated into a chip. Power consumption is 206M Hz/400mW Assabet development board is based on the SA1110, and have PCMCIA / CF slot and the JTAG interface, can be used to debug 32M of memory and 32M of flash SA1110 see a detailed description of the datasheet: sa1100-278240.pdf

1.4 ecos / redboot

eCos source code and related tools can be obtained from the eCos home page: http://sources.redhat.com/ecos eCos support for a variety of platforms, including ARM / Hitachi / SH / NEC / PPC / MIPS / SPARC, etc. ECos Redboot is the bootloader, the equivalent of PC's bios Redboot Supporting JTAG Debug and network cards capable of supporting assabet on the flash, PCMCIA / CF card, serial / parallel port

1.5 Common terminology

Host: generally refers to the development of PC, here is: PIII 1G 256M + redhat 7.3, that is i686-pc-linux-gnu Target: refers to the development board assabet, that is arm-linux Build: refers to the current work of the compiler tools where the host Construction: general do not promote direct compiler source directory, but create a new build directory, configure script generated through the build code, and then compile. Here, all the build directory in / opt / build under cross-compile: cross compiler tools, the compiler is able to host the target process to run here on the / opt / arm under target root directory: target running on procedures and systems stored in the host's root directory, this is / opt / arm / arm-linux

Cross Compiler Tools

2 Preparation
2.0 Update the local gcc compiler
2.1 the establishment of the Kernel header files
2.2 Compiling binutils tools
2.3 Compiling C compiler
2.4 compiler GLIBC Library
2.5 Compiling C + + compiler
2.6 compile kernel and hello world

2 Preparation

The development of related directories

% mkdir-p /opt/orig
% mkdir-p /opt/src
% mkdir-p /opt/build
% mkdir-p /opt/arm

All files are copied to the /opt/orig under

2.0 Update the local gcc compiler

Source file gcc-2.95.3.tar.gz Root user to compile:

# cd / opt / src
# tar-xzvf / opt/orig/gcc-2.95.3.tar.gz
# mkdir-p / opt / build / gcc-local
# cd / opt / build / gcc-local
# / opt/src/gcc-2.95.3/configure
- prefix = / usr
# make; make install
Confirmed that GCC version 2.95.3
# gcc - version

2.1 the establishment of the Kernel header files

Source Files

  • linux-2.4.18.tar.gz
  • patch-2.4.18-rmk3.gz
  • diff-2.4.18-rmk3-pxa2.gz

Patch

% cd /opt/src
% tar -xzvf /opt/orig/linux-2.4.18.tar.gz
% gzip -dc /opt/orig/patch-2.4.18-rmk3.gz | Patch -p1 -d /opt/src/linux
% gzip -dc /opt/orig/diff-2.4.18-rmk3-pxa2.gz | Patch-p1-d /opt/src/linux
% mkdir -p /opt/arm/arm-linux/include

ARM linux kernel configuration

% cd /opt/src/linux/
% cp arch/arm/def-configs/assabet.config
% yes "" | make oldconfig ARCH = arm
% make dep

Here to be wrong, do not affect!

% cp -arf include/asm-arm /opt/arm/arm-linux/include/asm
% cp -arf include/linux /opt/arm/arm-linux/include/linux

2.2 Compiling binutils tools

Source file

  • binutils-2.12.tar.gz

Compiler:

% cd /opt/src
% tar -xzvf src/binutils-2.12.tar.gz
% mkdir -p /opt/build/binutils
% cd /opt/build/binutils
% /opt/src/binutils-2.12/configure -target=arm-linux -prefix=/opt/arm
% make; make install

Bin tool generated here is used to implement ELF format, the prefix to use arm-linux.

Bin tool will add the implementation of the path:

% export PATH=/opt/arm/bin:$PATH

Do not forget the $ HOME/.bashrc_profile add the above statement, so that the path to amend the long-term effective

2.3 Compiling C compiler

Compiler C++ compiler, must be compiled after GLIBC can be carried out.

Here, the first compiler C compiler, and then use the C compiler to compile gLibC, and then compile C++ compiler To remember the host type (in the follow-up required), usually configure the implementation of the first line:

"Configuring for a i686-pc-linux-gnu host"

Here the use of "local compiler GCC" in the source tree

Compiler:

% mkdir -p /opt/build/gcc
% cd /opt/build/gcc
% /opt/src/gcc-2.95.3/configure -target=arm-linux -prefix=/opt/arm -with-cpu=strongarm -disable-languages -with-headers=/opt/src/linux/include
% make -i; make -i install

Here to make belt -i option, is to make the process ignore all errors. If you do not take this parameter, then the compiler should not correct glibcc.a document and compile GLIBC Error

2.4 compiler GLIBC Library

Source file

  • glibc-2.2.5.tar.gz
  • glibc-linuxthreads-2.2.5.tar.gz

Ready source:

% cd /opt/src
% tar -xzvf /opt/orig/glibc-2.2.5.tar.gz
% cd glibc-2.2.5
% tar -xzvf /opt/orig/glibc-linuxthreads-2.2.5.tar.gz
% mkdir -p /opt/build/glibc
% cd /opt/build/glibc

C compiler compiler recorded when host type, here for the --build type, because of this type, configure can not identify.

Configure the compiler:

% CC=arm-linux-gcc /opt/src/glibc-2.2.5/configure -target=arm-linux -build=i686-pc-linux-gnu -enable-add-ons -prefix=/opt/arm/arm-linux
% make; make install

Just now is to target the compiler GLIBC; but cross compiler tools need GLIBC library, compiled C + + compiler

Configure the compiler:
<pre>
% CC=arm-linux-gcc /opt/src/glibc-2.2.5/configure -target=arm-linux -build=i686-pc-linux-gnu -enable-add-ons -prefix=/opt/arm
% make; make install

2.4 compiler GLIBC Library, In fact, can also directly copy:

% cp -arf /opt/arm/arm-linux/include/* /opt/arm/include
% cp -arf /opt/arm/arm-linux/lib/* /opt/arm/lib

However, under such circumstances, it is necessary to manually modify the file /opt/arm/lib/libc.so:

GROUP (/ opt/arm/lib/libc.so.6 / opt / arm / lib / libc_nonshared.a)

2.6 compile kernel and helloworld

Compiled kernel:

% cd /opt/src/linux
% make dep ARCH=arm
% make zImage ARCH=arm

Source file hello.c:

# include <stdio.h>
int main () (
  Printf ( "hello world \ n");
Return 0;
)

Cross-compiler environment to use tools to compile hello.c

% arm-linux-gcc-v-o helloarm hello.c

3 compiler boot loader

boot loader selection of red hat's redboot.

Detailed user: http://pficheux.free.fr/eyrolles/linux_embarque/- docs_externes / redboot.pdf

Off-the-shelf binary file: http://kernel.pe.kr/pub/armlinux/people/nico/

User redboot detailed notes on assabet part 5.5 Intel SA1110 (Assabet) Here with details on how to compile source boot loader.

3 compiler redboot
3.1 Preparation mainframe environment
3.2 compiler ecosconfig
3.3 compiler arm-elf
3.4 compiler redboot

3.1 Preparation mainframe environment

Ftp://ftp.skynet.ie/cvs/ecos-latest.tar.gz for the latest from Ecos

Now using on /opt/src under ecos.tgz:

% cd /opt/src
% tar -zxvf /opt/orig/ecos.tgz
% export ECOS_REPOSITORY=/opt/src/ecos/packages

3.2 compiler ecosconfig

Ecosconfig is eCos configuration tool, the compiler generated ecosconfig general more than the direct download not easy problems:

% mkdir -p /opt/build/ecosconfig
% mkdir -p /opt/ecos-tools
% cd /opt/build/ecosconfig
% /opt/src/ecos/configure -prefix=/opt/ecos-tools -with-tcl=/usr
% make; make install
% export PATH=/opt/ecos-tools/bin:$PATH

3.3 compiler arm-elf

Ecos using arm-elf tools, compiler front of the arm-linux also can be used, but often out of order.

Here specifically for the eCos redboot compiler arm-elf tools, under normal circumstances, it is very difficult for other places

Source used, are retained in front of /opt/src under:

  • /opt/src/gcc-2.95.3
  • /opt/src/binutils-2.12

Arm-elf storage directory:

  • /opt/arm-elf

Compile binutils:

% mkdir /opt/build/binutils-elf
% cd /opt/build/binutils-elf
% /opt/src/binutils-2.12/configure -target=arm-elf -prefix=/opt/arm-elf
% make; make install
% export PATH=/opt/arm-elf/bin:$PATH

Compiler GCC:

% mkdir /opt/build/gcc-elf
% cd /opt/build/gcc-elf
% /opt/src/gcc-2.95.2/configure -target=arm-elf -prefix=/opt/arm-elf -with-gnu-as -with-gnu-ld
% make all-gcc LANGUAGES="C C++"
% make install-gcc LANGUAGES="C C++"

3.4 compiler redboot

% mkdir /opt/assabet-redboot
% cd /opt/assabet-redboot
% ecosconfig new assabet redboot
% ecosconfig import /opt/ecos/packages/hal/arm/sa11x0/assabet/current/misc/redboot_RAM.ecm
% ecosconfig tree
% make

If you are using arm-linux, are:

% make COMMAND_PREFIX=arm-linux

Generated in redboot /opt/assabet-redboot/install/bin under.

There will be four one format, select redboot.bin:

$ cp install/bin/redboot.bin /opt/

4 burner redboot

Use Jflash-linux, through the JTAG (target) + parallel port (host) on the flash for assabet burner

Selected Jflash-1.2-1, and made changes to keep for Jflash-1.2-1.tgz

Compiler Jflash:

# cd /opt/src
# tar -zxvf /opt/orig/Jflash-1.2-1.tgz
# cd Jflash-1.2-1
# make -f Makefile.linux

JTAG data line to the JTAG 16pin connector assabet received, will JTAG serial data lines connected to the host parallel port connector on Assabet. connect the power supply, generated by burning in front of redboot.bin:

# ./Jflash-linux /opt/redboot.bin
# minicom

Configure serial port: In the MINICOM window, ctrl + z, post-release, fast press o, serial port for configuration (38400,8 N1) Assabet and then restart, it will appear in the MINICOM redboot serial interface.

5 use redboot

Redboot now has a flash in assabet

redboot through the serial port / CF card assabet download the file to the memory and can be the contents of memory stored in the flash on Because the serial port to download files is too slow, only CF card through the introduction tftp download a file

Brief description of the process of setting up tftp server:

Rpm with tftpd and tftp to install the rpm file

$ mkdir /tftpboot

Use setup tool system service option, the opening tftp server

Xinetd tools used to activate:

# xinetd

Kernel will be well placed in front of the compiler in the / tftpboot under:

$ cp /opt/src/linux/arch/arm/boot/zImage /tftpboot

Host pc using ifconfig View the IP, here credited as follows:

  • 192.168.0.200

Insert the CF card will assabet the CF slot, and restart assabet, enter redboot interface.

redboot user interface, the set target on the CF card redboot the IP to 192.168.0.201:

Redboot> fconfig

IP settings Fconfig detailed description, see redboot.pdf

6 loading and implement kernel

Download kernel:

RedBoot> load -m TFTP -h 192.168.0.200 zImage -r -b 0x100000

Burner kernel:

RedBoot> fis create kernel -b 0x100000 -l 0xc0000
  Implementation of kernel:
RedBoot> exec -b 0x100000 -l 0xc0000 -c "root=/dev/ram" -r 0x800000

Here's to ram file system as the root directory. Do not have, so Tip:

Kernel panic: VFS: Unable to mount root fs on 01:00

7 loaded and run the file system

There is a ram size 8M system files ramimg.gz, There is a useful bash/busybox and other commonly used procedures. Actually used the space 3.6M

View the contents of ram system:

# zcat ramimg.gz > ramimg
# mkdir /mnt/assabet
# mount -o loop ramimg /mnt/assabet

If you need to add the contents of RAM file system:

# cp somethingForARM /mnt/assabet
# umount /mnt/assabet
# rm -rf ramimg.gz
# gzip -9 ramimg
# cp ramimg.gz /tftpboot

Run the file system:

RedBoot> load -m TFTP -h 192.168.0.200 zImage -r -b 0x100000
RedBoot> load -m TFTP -h 192.168.0.200 ramimg.gz -r -b 0x800000
RedBoot> exec -b 0x100000 -l 0xc0000 -c "root=/dev/ram" -r 0x800000