Computer System Laboratory

Slides:



Advertisements
Similar presentations
Computer System Laboratory
Advertisements

Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
CS201 – Makefile Tutorial. A Trivial Makefile # Trivial Makefile for puzzle1.c # Ray S. Babcock, CS201, MSU-Bozeman # 1/5/05 # puzzle1: puzzle1.c gcc.
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.
Install Software in Ubuntu. Do you have Internet? Everything is on the Internet and Free!
Computer System Laboratory
COMPUTER SYSTEM LABORATORY Lab8 - Debugging II. Lab 8 Experimental Goal Learn how to debug Linux in source-level by Domingo and diagnose target boards.
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.
Building a Cross Compiler, Assembler and Linker Designed by Prof. Peng-Sheng Chen.
Module 10 – Linux Installations. Wikipedia: Red Hat Package Manager or RPM Package Manager (RPM) is a package management system. The name RPM variously.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
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
COMPUTER SYSTEM LABORATORY Lab10 - Sensor II. Lab 10 Experimental Goal Learn how to write programs on the PTK development board (STM32F207). 2013/11/19/
For OS Experiments. What Do We Need? A Computer &
Computer System Laboratory
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Nachos Projects Overview and Project 1 TA : 吳哲榮 2010/10/21.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
Cross-Compiler Issues EPICS Meeting, May 2001 Markus Janousch (SLS)
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 8: Installing Software in Linux Chapter 13: Downloading and Installing Software By Fred R.
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.
Implementation of Embedded OS Lab3 Linux Kernel Modules.
Run your first C program.  Bring your computers to class  No prior programming experience is needed  Hours spent  Sakai  TAs.
Cole David Ronnie Julio Sam Littlefield. Let’s Begin  Globus Toolkit runs on Unix platform only  Install Ubuntu  download all updates for Ubuntu.
Lab 14 Department of Computer Science and Information Engineering National Taiwan University Lab14 – Camera 2014/12/30 1 /14.
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.
Nachos Overview and Project 1. Nachos Introduction Official website
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.
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
 CSC 215 : Procedural Programming with C C Compilers.
Ns2 Installations and Basics Abdul Razaque. How to install Ubuntu on windows-7 & 8 Download the Ubuntu ISO file. You can get the ISO file from the Ubuntu.
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
Installing Software Part 3
Install external command line softwares
OS Homework 1 February 22, 2017.
Implementation of Embedded OS
Introduction to .NET Core
Computer System Laboratory
The Linux Operating System
Operating System Kernel Compilation
University of Texas Rio Grande Valley Systems Administration CSCI 6175
Compilers, Make and SubVersion
Getting Started: Developing Code with Cloud9
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Operating System Kernel Compilation
Presentation transcript:

Computer System Laboratory Lab3 - Cross Tools

Experimental Goal Build a development environment for embedded systems. Cross compiler, assembler, linker Cross C standard library C program compiler Assembly language program assembler Transforms the C program into an assembly language program Object: Machine language module Object: Library routine (machine language) linker Executable: Machine language program 2013/10/1 / 15

Environment Host System Build System Target System Software 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 You can download all software from RSWiki CSL Course Software 2013/10/1 / 15

Change Apt Sources List Ubuntu 8.04 is now out of support and no longer receiving updates and security patches. There are repositories available at http://old- releases.ubuntu.com. Step1: modify /etc/apt/sources.list. % sudo sed -i -e 's/tw.archive.ubuntu.com\|security.ubuntu.com/old- releases.ubuntu.com/g' /etc/apt/sources.list You have to be careful of the area which was set during the installation. If you chose the area other than Taiwan, you have to modify the command to the correct one. You can type “man sed” to see more information. Step2: upgrate the sources list. % sudo apt-get update 2013/10/1 / 15

GNU Cross-Binutils Compilation (1/2) Prerequisite % sudo apt-get install libc6-dev texinfo vim patch Step1: download the source codes. % wget http://eraser.csie.ntu.edu.tw/courses/csl/10201/lab3/software/binut ils-2.16.1.tar.gz Step2: extract the source codes. % tar zxvf binutils-2.16.1.tar.gz Step3: set configuration before you compile the source codes. % cd binutils-2.16.1 % ./configure --target=arm-elf --prefix=$HOME/<your path> configure command is used to automatically create a Makefile according to your configurations. Makefile is used to specify how to build your source codes. 2013/10/1 / 15

GNU Cross-Binutils Compilation (2/2) Step4: compile the cross-binutils. % make -j4 Step5: install the cross-binutils. % make -j4 install Step6: append the installation directory to PATH. % sudo vim /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/g ames:$HOME/<your path>/bin" % source /etc/environment If you open another terminal, you need to source again. Test your cross-binutils. % arm-elf-as -version 2013/10/1 / 15

GNU Cross-Compiler Compilation (1/2) Step1: download the source codes. % wget http://eraser.csie.ntu.edu.tw/courses/csl/10201/lab3/software/gcc- 3.3.6.tar.gz Step2: extract the source codes. % tar zxvf gcc-3.3.6.tar.gz Step3: set configuration. % cd gcc-3.3.6 % ./configure --target=arm-elf --prefix=$HOME/<the your path previously> --enable-languages=c --with-newlib Step4: compile the cross-compiler. % make -j4 2013/10/1 / 15

GNU Cross-Compiler Compilation (2/2) Step5: install the cross-compiler. % make -j4 install Test your cross-compiler. % arm-elf-gcc -v 2013/10/1 / 15

GNU Cross-Newlib Compilation (1/3) Step1: download the source codes. % wget http://eraser.csie.ntu.edu.tw/courses/csl/10201/lab3/software/newli b-1.14.0.tar.gz Step2: extract the source codes. % tar zxvf newlib-1.14.0.tar.gz Step3: apply the patch. % cd newlib-1.14.0 % wget http://eraser.csie.ntu.edu.tw/courses/csl/10201/lab3/software/makei nfo_version.patch % patch < makeinfo_version.patch 2013/10/1 / 15

GNU Cross-Newlib Compilation (2/3) Step4: set configuration. % ./configure --target=arm-elf --prefix=$HOME/<the your path previously> Step5: compile the cross-newlib. % make -j4 Step6: install the cross-newlib. % make -j4 install Test a assembly code generation. The test source code, test1.c, can be downloaded from our course website. % arm-elf-gcc -S test1.c % vim test1.s 2013/10/1 / 15

GNU Cross-Newlib Compilation (3/3) Test an executable. % arm-elf-gcc test1.c -o test1 % file test1 2013/10/1 / 15

Install PXA270 Cross-Compiler (1/2) 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 (新華). Step1: download new cross-compiler. % wget http://eraser.csie.ntu.edu.tw/courses/csl/10201/lab3/software/arm- linux-toolchain-bin.4.0.2.tar.gz 2013/10/1 / 15

Install PXA270 Cross-Compiler (2/2) Step2: extract the tar.gz file to the home directory. % tar zxvf arm-linux-toolchain-bin.4.0.2.tar.gz -C $HOME Step3: append the installation directory (bin) to PATH. Do not forget to source again to load new PATH. Test the new cross-compiler. % arm-unknown-linux-gnu-gcc -v 2013/10/1 / 15

Compile a PXA270 Executable Step1: 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. Step2: transfer the executable to Linux on PXA270. Step3: change the permission of the executable. $ chmod +x test1 Step4: try to execute test1. 2013/10/1 / 15

Lab Requirement & Bonus Show that you can cross compile a program for PXA270. Bonus: Answer the question of lab3 on RSWiki CSL course website. Write it in your report. Please send your report to both TAs. csiedatou@gmail.com, meenchen79@gmail.com Please use this title format: [CSL] G# Lab# Ver# E.g., [CSL] G13 Lab3 Ver1 2013/10/1 / 15