1 Embedded system 2009/7/16 曹伯瑞. 2 Outline What is Embedded System Embedded System Booting Process Setup Host/Target Development Host / Target Development.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux Booting Procedure
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Booting the Linux Kernel Dr. Michael L. Collard 1.
1 Embedded system 2008/7/16 莊宜勳. 2 Outline What is Embedded System Embedded System Booting Process Setup Host/Target Development Host / Target Development.
Linux+ Guide to Linux Certification, Second Edition
Presented by: GREG UNGERER Lineo Inc 825 Stanley St Woolloongabba Qld 4102 Australia Ph: Building x86 Based.
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
Leveraging WinPE and Linux Preboot for Effective Provisioning Jonathan Richey | Director of Development | Altiris, Inc.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
14.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
1 Web Server Administration Chapter 3 Installing the Server.
System initialisation
Lesson 4-Installing Network Operating Systems. Overview Installing and configuring Novell NetWare 6.0. Installing and configuring Windows 2000 Server.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Installing software on personal computer
Embedded Linux Sandeep Sirpatil Graduate Student University of North Carolina Charlotte Feb 7, 2005.
1 THE ARCHITECTURE FOR THE DIGITAL WORLD TM THE ARCHITECTURE FOR THE DIGITAL WORLD Embedded Linux for ARM Architecture.
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.
Lesson 4 Computer Software
Lesson 4: What Is Software?
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
1 uClinux course. 2 Author: D L Johnson Overview u Day 1 +Survey of embedded operating systems - why uclinux? +The uclinux environment - the directory.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
Operating Systems Operating System
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
Linux Booting Procedure
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Tutorial 11 Installing, Updating, and Configuring Software
Embedded Linux porting Kernel
Learning Targets Identify the external parts of the computer Identify examples of input devices Identify examples of output devices Define basic computer.
Embedded Linux Systems Presented By: Kitrek Riese.
CIS 191 – Lesson 2 System Administration. CIS 191 – Lesson 2 System Architecture Component Architecture –The OS provides the simple components from which.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
14 Step-by-Step Instructions for an Upgrade Installation n Prepare for the installation Verify that all devices and applications are Windows 2000 compatible.
COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
1 uClinux course Day 2 of 5 Using configuration tools and the tool chain.
Implementation of Embedded OS Lab3 Porting μC/OS-II.
Linux Kernel Programming (LKP). LKP New sub-course New sub-course We will learn together We will learn together Evaluation of this part of course will.
The Linux Operating System R.Bigelow. What is an Operating System An operating system is a collection of programs that manage a computer's resources.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 – Bootloader + OS Kernel 2015/10/27/ 25 1.
Implementation of Embedded OS
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
Embedded Software Design Week II Linux Intro Linux Kernel.
Linux on ARM7TDMI or Nothing is as easy as it looks Helicon technologies Ltd. How to run uClinux on NXP LPC22xx.
Embedded Linux By Gus Wirth. What makes it embedded? ● Rather nebulous, line has blurred over the years ● Limited purpose ● Small resources compared to.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux system development.
1 Remote Installation Service Windows 2003 Server Prof. Abdul Hameed.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
Operating System & Application Software
Guide to Linux Installation and Administration, 2e
Computer System Laboratory
Structure of Unix OS.
Booting Up 15-Nov-18 boot.ppt.
Computer System Laboratory
Instructor Materials Chapter 5: Windows Installation
Presentation transcript:

1 Embedded system 2009/7/16 曹伯瑞

2 Outline What is Embedded System Embedded System Booting Process Setup Host/Target Development Host / Target Development Setups Develop Tool Building OS Application Porting Install an application Optimizing Application Issues Virtual Machine Homework

3 What is Embedded System

4 Embedded System ? What Embedded System is a special-purpose computer system designed to specific functions. Where It can be found everywhere MP3 player, air condition, vehicle control system, and so on. How “We” often use linux-based operating system

5 The Scale of Embedded System Small-scale Low-power About 2 MB ROM, 4 MB RAM Medium-scale About 32MB ROM, 64MB RAM Perhaps with storage device EX: PDA, MP3 player Large-scale Power-full or multi-core Usually no resource constrain

6 System Layer Hardware Firmware Operating System Application Hardware Firmware Operating System Application Hardware Firmware Desktop computer Complex embedded computer Simple embedded computer

7 Architecture of Embedded Linux System

8 Hardware CPUs ARM (arm7tdmi, arm9, strongARM, Xscale, …etc.) MIPS X86, 8086 SH PowerPC… Memory Technology Device ROM Flash RAM HD or CF card or USB storage

9 Hardware (Cont’) Peripherals keypad USB device RS232 (UART) Network IrDA CF card others memory cards

10 Embedded OS DOS Palm OS WinCE Symbian Linux uCLinux - support non-MMU CPU RTLinux - for real-time system Android - Java and linux-based OS by google OpenMoko Etc.

11 Memory Management Unit (MMU) CPU Core Memory MMU CPU Physical Address Virtual Address

12 Library GNU C Library – glibc Standard Include several libraries, ex: libm, libc, and so on. Too large for embedded system uC-libc Original designed for uClinux For No MMU system Support m68000, ColdFire and ARM Most APIs are compatible to Glibc, but not all uClibc Also support MMU More compatible to glibc, but still not all Support m68000, ColdFire, ARM, MIPS, x86, SuperH, PowerPC Support share library

13 Booting Process

14 What the hell is the black box doing? Power on BIOS Load the hardware configuration Find the booting device MBR of booting device MBR (master boot record) is in the first sector of booting device Boot loader is stored in the MBR of booting device When booting, it will read the booting information of boot loader in MBR.

15 It’s time to prepare for working Loading Kernel Boot loader knows where the kernel is stored. De-compress the compressed kernel image and start to drive the hardware device. Init The first executed process is init. It reads the file “/etc/inittab” Run-level run some application of /etc/rc.d/rcx.d Login /bin/login

16 Root Filesystem Root filesystem contains the set of applications, libraries, and related files needed to run the system According to the requirement of the system, the architecture of Root filesystem is different. Generally, the most useful directories of root filesystem are bin dev etc lib sbin usr proc*

17 MBR addressDescriptionSize (byte) 0Code area440 (max 446) 440Optional Disk signature4 444Usually Nulls; 0x Table of primary partitions64 510MBR signature2 Total : 512 bytes

18 What is boot loader ? Definition of Boot Loader The first section of code to be executed after the embedded system is powered on. Boot Loader in x86 PC consists of two parts BIOS (Basic Input/Output System) OS Loader (located in MBR of Hard Disk) Ex. LILO and GRUB In some embedded systems the role of the boot loader is more complicated Since these systems may not have a BIOS to initial system configuration

19 Boot loader Boot Loader is varied from CPU to CPU, from board to board Since Boot Loader is very close to hardware Hardware manufacturer may provide corresponding boot loader. Examples: LILO 、 GRUB x86 compatible boot loader PPCBOOT Boot loader for PowerPC based embedded Linux systems

20 Boot loader (Cont’) PMON For MIPS architecture Das U-Boot “Universal Boot loader“ For PowerPC, ARM, XScale, MIPS, Coldfire, NIOS, x86, etc.

21 BTW Because of the boot loader functionality, the boot loader we use have to depend on our OS The boot loader have to “know” the kernel file-system. LILO and GRUB support Windows and Linux, but the windows boot loader does not.

22 GRUB grub.conf default 0 timeout 5 title Fedora Core root (hd0,0) kernel /vmlinuz root=/dev/sda1 initrd /initrd img title=Windows XP root (hd0,5) makeactive chainloader +1

23 Setup Host/Target Development

24 First type of Host/Target Development Setups Linked Setup Host contains the cross-platform development environment Target contains an appropriate bootloader, kernel, and root filesystem Kernel could be available via TFTP Root filesystem could be NFS

25 Second type of Host/Target Development Setups Removable Storage Setup OS is written into storage by the host, and then is transferred to the target, and is used to boot the target device Host contains the cross-platform development environment Target contains bootloader The rest of the components are stored on a removable storage media

26 Third type of Host/Target Development Setups Standalone Setup Target is a self-contained development system and includes all the required software to boot, operate, and develop additional software

27 Heterogeneous Environment

28 Cross-Compiler Toolchain Toolchain means not only compiler But also Library, Linker (ld), assembler (as), other binutils, etc. For two reasons we need the Toolchain Different architecture (ex: X86 & arm) Different Library Usually Toolchain is downloaded from Internet and just use it If you have to setup Toolchain by yourself, you will get into big trouble

29 Setup Cross-Compiler Toolchain (1/3) Components gcc binutils as, ld, nm, etc Library glibc or uClibc Patch Fix bug Add some functions

30 Setup Cross Compiler Toolchain (2/3) Versions are very important not all versions of one tool will build properly when combined with different versions of the others “New” doesn’t mean “Suitable” The only way to find the appropriate tool set is just “Try” or Google it

31 Setup Cross Compiler Toolchain (3/3) Five main steps 1. Kernel headers setup 2. Binary utilities setup 3. Bootstrap compiler setup Some languages supported by gcc, such as C++, require C library support Only support C language here 4. C library setup Compile library used in target system 5. Full compiler setup Build full compiler with C library

32 Develop Tool

33 Make and Makefile Development problems It is hard to manage the relationship of files in large project. Every change requires long compilation Motivation To manage the project well and automatically in the case of Many lines of code Multiple components More than one programmer

34 Make and Makefile (Cont’) A Makefile is a file (script) containing Project structure (files, dependencies) Instructions for files creation The “make” command reads a Makefile, understands the project structure and makes up the executable Note that the Makefile mechanism is not limited to C programs

35 Makefile Rule syntax

36 Makefile Example Example Program contains 3 files main.c, sum.c, sum.h sum.h included in both.c files Executable should be the file summary summary sum.o main.o sum.csum.h main.c

37 Makefile Example (Cont’) summary: main.o sum.o gcc -o summary main.o sum.o main.o: main.c sum.h gcc -c main.c sum.o: sum.c sum.h gcc -c sum.c

38 Building your OS

39 Building uClinux uClinux-dist Full source package including kernel, libraries and application

40 Platform Config make menuconfig/ make xconfig Select your platform & kernel version

41 Kernel Config Kernel setting

42 Application Config Application setting

43 Start to compile uClinux Compile make dep Check the dependence of files make make  Errors occur  solve it (Google it)  make again

44 Make for each components Make linux_only Used to make kernel Make user_only Used to make application Make lib_only Used to make necessary library Make romfs Produce Romfs (ROM file-system folder) Make image According Romfs folder, produce image file

45 Final output Finally, there are two files generated : zImage uClinux kernel 2.4.x compress image romfs.img Rom file-system Write files into corresponding location bootloader.bin zImage romfs.img

46 Application Porting

47 Install an application Advanced Packaging Tool The APT is a free user interface to handle the installation and removal of software on the Debian GNU/Linux OS and its variants. Ex: $apt-get install vlc Yellowdog Updater, Modified The YUM is an open-source command-line package- management utility for RPM-compatible Linux operating systems and has been released under the GNU General Public License. Ex: #yum install vlc Tarball install Use tar to compress source code in a file Use source code to compile and install

48 Tarball install Download application tarball and untar Configure configure -h for information about parameters Some times the Makefile is generated by configure configure --parameters Ex: configure --enable-release --enable-optimizations Compile make make  Errors occur  solve it (Google it)  make again make install Install application or lib into specific location

49 Example: VLC Environment Fedora Core 6 Kernel: vlc-0.8.6b.tar.bz2 configure --enable-dvb make; make install

50 When installing Add the path of Toolchain to PATH export PATH=/example/toolchain/path:$PATH --prefix=PREFIX Indicate where to install application --target=TARGET configure for building compilers for TARGET [HOST]

51 Optimizing Application Issues

52 Down Size Remove unused part of application configure --disable-(something) Reduce binary code size strip One of binutils tool Strip symbols and debug messages from object files uClinux ELF -> FLAT Optimum size in compile time gcc -Os Cut down library Ace in the hole

53 Efficiency Dynamic linking -> Static Use more efficient function in program Ex: memcpy vs mmap Even use assembly language to rewrite critical part Optimum in configure configure --enable-release --enable-optimizations Turn up gcc optimum level gcc -O0 ~ -O3

54 ETC. Low response time Minimal memory usage Power saving

55 Virtual Machine

56 Virtualization At one time, desktop computers were “one machine, one operating system, one application” The advent of “one machine, one operating system, many applications” Today, virtualization lets users have “one machine, multiple operating systems, multiple applications” Lets developers easily test their programs on multiple OSs

57 Virtual Machine

58 Virtual Machine (Cont’)

59 VMWare Workstation VMware Workstation is a virtual machine software suite allows users to set up multiple x86 and x86-64 virtual computers and to use one or more of these virtual machines simultaneously with the hosting operating system.

60 VirtualBox VirtualBox is a general-purpose full virtualizer for x86 hardware. Targeted at server, desktop and embedded use, it is now the only professional- quality virtualization solution that is also Open Source Software.

61 Homework

62 VLC Fulfill install process of VLC by page 49 Use Tarball (Source code) install Report configure parameters, encountering problems, the result and what you has learned from this The VLC you install should can play music (ex:*.mp3) and Video (ex:*.avi)

63 Reference Building Embedded Linux Systems, Karim Yaghmour, O’Reilly, 2003 uClinux, VideoLAN developers,

64 This slider was originally written by lijw in 2006 revised by erdatsai in 2007 revised by JACKY in 2008 revised by sppm in 2009