Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.

Slides:



Advertisements
Similar presentations
Computer System Laboratory
Advertisements

Program Development Tools The GNU (GNU’s Not Unix) Toolchain The GNU toolchain has played a vital role in the development of the Linux kernel, BSD, and.
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
1 UQC122S3 Real-Time and Embedded Systems GCC as a cross compiler.
1 Real-Time System Design Developing a Cross Compiler and libraries for a target system.
Systems Programming Course Gustavo Rodriguez-Rivera.
Building the toolchain GET A FEEL!! [ These are the steps to install and build the toolchain on windows(cygwin) ]
Software Development and Software Loading in Embedded Systems.
Computer System Laboratory
Introduction Purpose Objectives Content Learning Time
COMPUTER SYSTEM LABORATORY Lab8 - Debugging II. Lab 8 Experimental Goal Learn how to debug Linux in source-level by Domingo and diagnose target boards.
A crash course in njit’s Afs
COMPUTER SYSTEM LABORATORY Lab4 - Bootloader. Lab 4 Experimental Goal Learn how to build U-Boot bootloader for PXA /10/8/ 142.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
August 21, 2015 NET+OS 6.0/GNU The GNU Tools. 2 GNU Cross Development Tool Basics The GNU Cross Development Tools are flexible The flexibility extends.
Building a Cross Compiler, Assembler and Linker Designed by Prof. Peng-Sheng Chen.
Introduction Purpose This training course introduces the free GNU tools that can be used for debugging embedded system application software in the Renesas.
Input/Output Controller (IOC) Overview Andrew Johnson Computer Scientist, AES Controls Group.
Computer System Laboratory
1 Intro to Linux - getting around HPC systems Himanshu Chhetri.
COMPUTER SYSTEM LABORATORY Lab10 - Sensor II. Lab 10 Experimental Goal Learn how to write programs on the PTK development board (STM32F207). 2013/11/19/
Embedded Linux porting Kernel
Computer System Laboratory
Enabling the ARM Learning in INDIA ARM DEVELOPMENT TOOL SETUP.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
2INC0 Operating Systems Introduction to Linux
Internet of Things with Intel Edison Compiling and running Pierre Collet Intel Software.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
Cross-Compiler Issues EPICS Meeting, May 2001 Markus Janousch (SLS)
Conventions Department of Computer Science and Information Engineering National Taiwan University Conventions 2014/9/16/ 3 1.
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.
Lab 14 Department of Computer Science and Information Engineering National Taiwan University Lab14 – Camera 2014/12/30 1 /14.
Department of Computer Engineering Dongguk University Prof. Jin-Woo Jung Practice hour : 2008/11/14 8. Qt / Embedded.
Department of Computer Engineering Dongguk University Prof. Jin-Woo Jung T.A. Han-Mu Park
OS Project 0 February 25, Outline  Linux Installation  Linux Kernel Compilation  System Call Development  Kernel Modules / 452.
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
Implementation of Embedded OS Lab3 Porting μC/OS-II.
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 – Bootloader + OS Kernel 2015/10/27/ 25 1.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Environment Setup 2015/9/15/ 30 1.
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 – μC/OS 2015/10/13/ 13 1.
Implementation of Embedded OS
Tutorial on setting up Zebra: A Z39.50 Server ARD Prasad DRTC Indian Statistical Institute Bangalore.
Lab 7 Department of Computer Science and Information Engineering National Taiwan University Lab7 – uCOS Application 2015/11/10/ 10 1.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
ECE 544 Software Project 1 Kuo-Chun Huang (KC). Environment Linux (Ubuntu or others) Windows with Cygwin
김민수 Cortex-M4 Processor - Getting Started with the GNU Compiler Collection(gcc)
Introduction to SimpleScalar Tool Set CPEG323 Tutorial Long Chen September, 2005.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
Computer System Laboratory
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
Computer System Laboratory
Implementation of Embedded OS
Homework Reading Assignment Lab 1 MP1
Computer System Laboratory
Install external command line softwares
Implementation of Embedded OS
Computer System Laboratory
Chapter 2 Setup.
SAPC Hardware Pentium CPU (or 486) 4M usable memory
Getting Started: Developing Code with Cloud9
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Presentation transcript:

Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Build a development environment for embedded systems.  Cross compiler, assembler, linker  Cross C standard library 2014/10/7/ 20 2

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Host System  Windows XP  Build System  VirtualBox + Ubuntu 8.04  Target System  Creator XScale PXA270  Software  GNU Binutils  GNU Compiler Collection (GCC)  Red Hat Newlib  makeinfo_version.patch  Simple Linux Kernel for PXA270  Simple File System for PXA270  Cross Compiler for PXA270  You can find all software on RSWiki CSL Course Software.RSWiki CSL Course Software 2014/10/7/ 20 3

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  The GNU Binutils are a collection of binary tools for creating and managing binary programs, libraries, and assembly source code.  The main tools are:  ld : the GNU linker  as : the GNU assembler  The GNU binutils are typically used in conjunction with compilers such as the GNU Compiler Collection ( gcc ), build tools like make, and the GNU Debugger ( gdb ). 2014/10/7/ 20 4 Reference:

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Prerequisite  % sudo apt-get install libc6-dev texinfo vim patch  Step 1: download the source codes.  % cd ~  % wget ils tar.gz ils tar.gz  Step 2: extract the source codes.  % tar zxvf binutils tar.gz  Step 3: set configuration before you compile the source codes.  % cd binutils  %./configure --target=arm-elf --prefix=$HOME/  configure command is used to automatically create a Makefile according to your configurations.  Makefile is used to specify how to build your source codes. 2014/10/7/ 20 5

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 4: compile the cross-binutils.  % make  Step 5: install the cross-binutils.  % make install  Step 6: append the bin directory to PATH.  % nano ~/.bashrc export PATH="$PATH:$HOME/ /bin"  % source ~/.bashrc  You can also reopen the terminal, and.bashrc will be sourced in the shell startup process.  Test your cross-binutils.  % arm-elf-as -version 2014/10/7/ 20 6

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages.  GCC has been ported to a wide variety of processor architectures, and is widely deployed as a tool in the development of software, and it is also available for most embedded platforms.  The main tool is gcc. 2014/10/7/ 20 7 Reference: Wikipedia

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 1: download the source codes.  % cd ~  % wget tar.gz tar.gz  Step 2: extract the source codes.  % tar zxvf gcc tar.gz  Step 3: set configuration.  % cd gcc  %./configure --target=arm-elf --prefix=$HOME/ --enable-languages=c --with-newlib 2014/10/7/ 20 8

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 4: compile the cross-compiler.  % make  Step 5: install the cross-compiler.  % make install  Test your cross-compiler.  % arm-elf-gcc -v 2014/10/7/ 20 9

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  The C standard library is the standard library for the C programming language, as specified in the ANSI C standard.  There are many implementations of C library.  GNU C Library, used in Linux  Newlib  μClibc, a C standard library for embedded μClinux systems  Microsoft C Run-time Library, part of Microsoft Visual C++  Etc.  Newlib is a C standard library implementation intended for use on embedded systems. 2014/10/7/ 20 10

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 1: download the source codes.  % cd ~  % wget b tar.gz b tar.gz  Step 2: extract the source codes.  % tar zxvf newlib tar.gz  Step 3: apply the patch.  % cd newlib  % wget nfo_version.patch nfo_version.patch  % patch < makeinfo_version.patch 2014/10/7/ 20 11

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 4: set configuration.  %./configure --target=arm-elf --prefix=$HOME/  Step 5: compile the cross-newlib.  % make  Step 6: install the cross-newlib.  % make install 2014/10/7/ 20 12

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Write a simple C program.  % cd ~  % nano test1.c #include void main() { printf("hello world\n"); }  Test a assembly code generation.  % arm-elf-gcc -S test1.c  % nano test1.s  Test an executable.  % arm-elf-gcc test1.c -o test1  % file test1 2014/10/7/ 20 13

Lab 3 Department of Computer Science and Information Engineering National Taiwan University 2014/10/7/ x x x x U-Boot diag Flash 0xA xA xA uImage (TFTP) RAM 0x x Linux kernel Root Filesystem 0xA rootfs (TFTP)

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 1: download uImage and rootfs into TFTP server. uImage rootfs  Step 2: enter U-Boot in PXA270, or use the debugger Domingo.  Step 3: download and copy uImage to flash address 0x  You can download to RAM address 0xA for TFTP.  The erased end address is 0x47FFFF (32 sectors).  It will take about 3 minutes.  Step 4: download and copy rootfs to flash address 0x  You can download to RAM address 0xA for TFTP.  The erased end address is 0x137FFFF (120 sectors).  It will take about 3 minutes.  Tips:  You can refer to the steps by which you copy U-Boot to flash in lab /10/7/ 20 15

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 5: change U-Boot environment settings.  u-boot$ setenv linux bootm  u-boot$ setenv bootcmd run linux  u-boot$ saveenv  Step 6: reset PXA270 and load Linux. 2014/10/7/ 20 16

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  However, since previous cross-compiler does not contain related PXA270 headers and configurations, it can not compile executable for PXA270.  Actually, it can only be used for U-Boot (bootloader) only.  If we want to cross compile a program which can be executed on PXA270, we should install the cross-compiler provided by microtime ( 新華 ).  Step 1: download the precompiled cross-compiler.  % wget linux-toolchain-bin tar.gz linux-toolchain-bin tar.gz 2014/10/7/ 20 17

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 2: extract the tar.gz file to the home directory.  % tar zxvf arm-linux-toolchain-bin tar.gz -C $HOME  Step 3: append the installation directory (bin) to PATH.  % nano ~/.bashrc  Do not forget to source again for new PATH.  Test the new cross-compiler.  % arm-unknown-linux-gnu-gcc -v 2014/10/7/ 20 18

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Step 1: use the new cross-compiler to compile test1.c.  % arm-unknown-linux-gnu-gcc -static test1.c -o test1  Please add “ -static ” flag to compile an executable with static library.  Step 2: transfer the executable to Linux on PXA270 via TFTP.  $ tftp -g -r  Note that the command is different from the one in U-Boot.  Step 3: change the permission of the executable.  $ chmod +x test1  Step 4: try to execute test1.  $./test1 2014/10/7/ 20 19

Lab 3 Department of Computer Science and Information Engineering National Taiwan University  Show that you can cross compile a Linux program for PXA270.  Please hand in your lab report to the FTP.  Server:  Username: csl2014  Password: csl2014HomeWork  Directory: lab3  Please use this format for filename: “G# Ver#”, where G# is your group id and Ver# is revision version number.  E.g., G1 Ver2 2014/10/7/ 20 20