The Embedded Linux Quick Start Guide In the Beginning... Embedded Linux Conference Europe 2010



Similar documents
Eddy Integrated Development Environment, LemonIDE for Embedded Software System Development

Overview. Open source toolchains. Buildroot features. Development process

The embedded Linux quick start guide lab notes

Track One Building a connected home automation device with the Digi ConnectCore Wi-i.MX51 using LinuxLink

Embedded Linux development training 4 days session

Virtualization and Other Tricks.

AVR32737: AVR32 AP7 Linux Getting Started. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Embedded Linux Systems

Efficient embedded software development using QEMU

STLinux Software development environment

Embedded Linux Platform Developer

Linux boot loader and boot in Raspberry Pi

Eclipse IDE for Embedded AVR Software Development

opensuse.org Build Service

SheevaPlug Development Kit README Rev. 1.2

Embedded Software Development

The Yocto Project Eclipse plug-in: An Effective IDE Environment for Embedded Application and System Developers

Going Linux on Massive Multicore

Embedded Software development Process and Tools: Lesson-4 Linking and Locating Software

Michele Jr De Candia Curriculum Vitae

Embedded Linux Systems

Altera SoC Embedded Design Suite User Guide

i.mx USB loader A white paper by Tristan Lelong

RISC-V Software Ecosystem. Andrew Waterman UC Berkeley

EXPLORING LINUX KERNEL: THE EASY WAY!

Distribution and development environment for ST40 platforms. Features. User programs and applications. File Systems.

Five standard procedures for building the android system. Figure1. Procedures for building android embedded systems

Android Development: a System Perspective. Javier Orensanz

An Embedded Wireless Mini-Server with Database Support

MontaVista Linux 6. Streamlining the Embedded Linux Development Process

Getting started with ARM-Linux

Open Network Install Environment (ONIE) LinuxCon North America 2015

Training Linux Debugging

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Developing an Application for the i.mx Devices on the Linux Platform

Developing applications on Yocto. Lianhao Lu Intel Corporation Feb. 29th, 2012

Pwn Plug Community Edition 1.1 Installation Guide

Software Development for Embedded GNU Radio Applications

Building Embedded Systems

SIM900 Eclipse environment install Application Note_V1.00

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Application Development Kit for Android Installation Guide

Build a GCC-based cross compiler for Linux

Easing embedded Linux software development for SBCs

LSN 10 Linux Overview

Real-time Debugging using GDB Tracepoints and other Eclipse features

Cosmic Board for phycore AM335x System on Module and Carrier Board. Application Development User Manual

Enhanced Project Management for Embedded C/C++ Programming using Software Components

WIND RIVER DIAB COMPILER

Buildroot Workshop. Libre Software Meeting Thomas Petazzoni Free Electrons

Development With ARM DS-5. Mervyn Liu FAE Aug. 2015

opensuse for ARM On Your Device Sonntag, 21. Oktober 12

Sistemi ad agenti Principi di programmazione di sistema

Embedded Linux development with Buildroot training 3-day session

Friendly ARM MINI2440 & Dalvik Virtual Machine with Android

Developing Embedded Linux Devices Using the Yocto Project

ERIKA Enterprise pre-built Virtual Machine

Adapting the PowerPC 403 ROM Monitor Software for a 512Kb Flash Device

Cross-Platform and Embedded Systems Development

Chapter 2. Basic Concepts Linux Workstation. 2.1 Types of Hosts

MontaVista Linux 6. Technical brief. Table of Contents» MontaVista Linux 6: The New approach to Embedded

Network connectivity controllers

VoIP Laboratory B How to re flash an IP04

Version 1.0. File System. Network Settings

TEGRA X1 DEVELOPER TOOLS SEBASTIEN DOMINE, SR. DIRECTOR SW ENGINEERING

Android NDK Native Development Kit

Embedded Linux Introduction

Developing Embedded Linux Devices Using the Yocto Project

Booting Linux from a USB Flash Device on MPC5200 Systems David Wolfe, Infotainment, Multimedia and Telematics Division

Intel Application Software Development Tool Suite 2.2 for Intel Atom processor. In-Depth

ANDROID DEVELOPER TOOLS TRAINING GTC Sébastien Dominé, NVIDIA

Red Hat Developer Toolset 1.1

How to Run the MQX RTOS on Various RAM Memories for i.mx 6SoloX

Programming Environment Setup

Matrix 510/520 User Guide

Java and Real Time Storage Applications

NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X

Notes and terms of conditions. Vendor shall note the following terms and conditions/ information before they submit their quote.

Building and Using a Cross Development Tool Chain

Using Intel C++ Compiler in Eclipse* for Embedded Linux* targets

Example of Standard API

Zynq-7000 Platform Software Development Using the ARM DS-5 Toolchain Authors: Simon George and Prushothaman Palanichamy

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / 22.

Yocto Project Eclipse plug-in and Developer Tools Hands-on Lab

STH SICS Thin Hypervisor Reference Manual Version 0.4

Quick Deployment Step-by-step instructions to deploy Oracle Big Data Lite Virtual Machine

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Frysk The Systems Monitoring and Debugging Tool. Andrew Cagney

Ubuntu ARM - What Is It?

Xeon Phi Application Development on Windows OS

Avaya Media Server Monitoring and Management. David Lover Chief Strategy and Technology Officer, Cross

How To Develop Android On Your Computer Or Tablet Or Phone

Application Note: AN00141 xcore-xa - Application Development

Open Network Linux A Network Operating System (NOS) for OCP

GIVE WINGS TO YOUR IDEAS TOOLS MANUAL

Application-Level Debugging and Profiling: Gaps in the Tool Ecosystem. Dr Rosemary Francis, Ellexus

Yocto Project ADT, Eclipse plug-in and Developer Tools

Building an audio player using the Texas Instruments OMAP-L137

RMLL Hello. thank you for coming

Transcription:

The In the Beginning... Chris Simmonds Embedded Linux Conference Europe 2010 Copyright 2010, 2net Limited 1

Overview Genesis of a Linux project The four elements Tool chain; boot loader; kernel; user space Element 1: Tool chain Element 2: Boot loader 2

I've just had this great idea... our next product will run Linux This workshop will take a look at Board bring-up Development environment Deployment 3

The four elements Toolchain (air) Boot loader (earth) Kernel (fire) User space (water) 4

First element: the toolchain You can't do anything until you can produce code for your platform A tool chain consists of at least binutils: GNU assembler, linker, etc. gcc: GNU C compiler C library (libc): the interface to the operating system gdb: debugger 5

Types of toolchain Native: run compiler on target board If your target board is not fast enough or doesn't have enough memory or storage, use an emulator e.g. qemu Cross: compile on one machine, run on another Most common option 6

The C library Gcc is built along side the C library Hence, the C library is part of the tool chain Main options are GNU glibc big but fully functional GNU eglibc glibc but more configurable; embedded-friendly uclibc small, lacking up-to-date threads library and other POSIX functions 7

Criteria for selecting a toolchain Good support for your processor e.g. for ARM A-8 core, armv4 compilers work OK but armv7t works better Appropriate C library Up-to-date Good support (community or commercial) Other goodies, e.g. Cross-compiled libraries and programs Development tools for tracing, profiling, etc. 8

Toolchain examples Free, minimal Codesourcery G++ Lite URL www.codesourcery.com Architectures ARM, MIPS, PPC, SH Free, binary Angstrom Debian Ubuntu Denx ELDK URL www.angstrom-distribution.org www.debian.org www.ubuntu.com www.denx.de Architectures ARM, PPC, AVR32, SH ARM, PPC ARM PPC (ARM, MIPS) 9

Toolchain examples Free, integrated build environment Buildroot OpenEmbedded LTIB Commercial MontaVista Linux Timesys LinuxLink Windriver Linux LynuxWorks BlueCat Linux Sysgo ElinOS URL www.buildroot.org www.openembedded.org www.bitshrine.org URL www.mvista.com linuxlink.timesys.com www.windriver.com www.lynuxworks.com www.sysgo.com Architectures ARM, PPC, MIPS ARM, PPC, AVR32, SH ARM, PPC Architectures 10

I got a toolchain with my board This is often a trap! Most board vendors don't have in-depth embedded Linux expertise Toolchain often out of date Wrong libc Poor selection of other development libraries No update policy Consider using a generic toolchain instead 11

Installing a toolchain Usually everything is in a single directory tree typically in /usr/local or /opt In which you will find... cross-compiler and debugger binaries cross tools have a prefix, such as arm-angstrom-linux-gnueabi-gcc header files and libraries for the target To use it, do something like: PATH=/usr/local/some_tool_chain/bin:$PATH arm-angstrom-linux-gnueabi-gcc my_prog.c -o my_prog 12

Adding libraries A minimal tool chain only has libc Example: we have structured data and want to use sqlite3. What to do? Worst case: cross compile it yourself libsqlite3 is not difficult; others are much worse You need Header files toolchain usr/include directory Library.a and.la files toolchain usr/lib directory Library.so files target usr/lib directory 13

Tip Choose a toolchain that comes with all (or most) of the libraries you will need for the project 14

Support for debugging For remote debugging of the target make sure your toolchain includes cross-development gdb and cross-compiled gdbserver Ideally it should include debug symbols in all the libraries Ideally it should include source code for the libraries 15

Other goodies Graphical IDE Eclipse with C/C++ Development Toolkit (CDT) Profilers Oprofile Memory patrol Tracers Linux Trace Toolkit 16

Second element: bootloader Initialise the hardware Set up SDRAM controller Map memory Set processor mode and features Load a kernel Optional (but very useful) Load images via Ethernet, serial, SD card Erase and program flash memory Display splash screen 17

Pre-boot loader Usually stored in flash memory Old days: NOR flash mapped to processor restart vector so whole boot loader stored as single image These days: first stage boot loader is stored in first page of NAND flash which is loaded by on-chip microcode Sequence: Pre-boot loader main boot loader kernel 18

Loading the kernel Primary task of boot loader is to Generate a description of the hardware e.g. size and location of RAM, flash,... Load a kernel image into memory (Optional) load a ramdisk image into memory Set the kernel command line (see later) Jump to kernel start vector, passing pointers to information about hardware kernel command line 19

Bootloader-kernel ABI: ATAGS ARM (and some others) the kernel is passed values in two registers R1 = machine number R2 = Pointer to ATAGS list The ATAGS are a linked list of tagged values. For example ATAG_CORE ATAG_MEM ATAG_CMDLINE ATAG_NONE ; mandatory (pagesize, rootdev) ; size, start physical addr ; Kernel cmdline ; end of list 20

Bootloader-kernel ABI: flattened Device Tree PPC (and others) use Flattened Device Tree (FDT) / device-tree name = device-tree model = MyBoardName... cpus name = "cpus"... memory@0 name = "memory" device_type = "memory"... PowerPC,970@0 name = "PowerPC,970" device_type = "cpu"... 21

Examples of boot loaders (Das) U-Boot PPC, ARM, MIPS, SH4 http://www.denx.de/wiki/u-boot/webhome Redboot PPC, ARM, MIPS, SH4 http://sources.redhat.com/redboot/ For PC hardware use BIOS together with GRUB or LILO 22

U-Boot command line Load a kernel image into memory from... NAND flash nand read 80100000 1000000 200000 SD card mmc rescan 1 fatload mmc 1:1 80100000 uimage TFTP server setenv ipaddr 192.168.1.2 setenv serverip 192.168.1.1 tftp 80100000 uimage Boot a kernel image in memory bootm 80100000 23

U-Boot environment Typical flash memory layout U-Boot U-Boot environment Kernel image, flash file systems, etc. U-Boot commands for environment setenv ipaddr 192.168.1.101 printenv ipaddr savvenv 24

Automating boot: bootcmd Set command to run when U-Boot starts setenv bootcmd tftp 80100000 uimage\;bootm 80100000 Set delay before bootcmd is execcuted setelv bootdelay 3 25

Summary Tool chain Cross or native Choice of C library: glibc, eglibc or uclibc Plus development libraries as needed Boot loader Initialises the hardware and loads a kernel Passes hardware description to kernel 26