Ottawa Linux Symposium 2007

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

Presented by: GREG UNGERER Lineo Inc 825 Stanley St Woolloongabba Qld 4102 Australia Ph: Building x86 Based.
Hands-on with the Sitara Linux SDK This presentation provides a hands-on overview of the Sitara Linux SDK. It focuses on the software and tools found in.
3 3 3 CHAPTER System Software. 3 © The McGraw-Hill Companies, Inc Objectives System software Programs, Functions, Categories Utilities Device drivers.
Embedded Systems Programming Introduction to cross development techniques.
Embedded System Programming Introduction to Device Drivers.
Embedded Real time System Design Introduction to the course.
Chapter 5 System Software.
Embedded Systems Programming Introduction to the course.
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.
Compact MythTV Frontend Advisor: Professor Wilsey Dustin Grimmeissen Richard Anderson David Kesler.
1 Embedded Linux porting Speaker: Yi-Ji Jheng Date:
Embedded Linux porting Kernel
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Seminar on Linux-based embedded systems
Porting Android to Beagleboard
Beagle Board Fast Boot Hui Chen Keji Ren Dec 10 th, 2009 EE382N-4 Project.
Exploring Suitability of Linux for Embedded Vision Applications Ankit Mathur Mayank Agarwal Mini Project.
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
CELF Project and Conference Information Tim Bird CELF Architecture Group Chair.
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
5 SYSTEM SOFTWARE CHAPTER
Unit - VI. Linux and Real Time: Real Time Tasks Hard and Soft Real Time Tasks Linux Scheduling Latency Kernel Preemption Challenges in Kernel Preemption.
Porting Linux Linux onto the Puppeteer SA1110. The Puppeteer board –SA1110 CPU –SMSC LAN91C96I ethernet –8 Mb Flash Intel 28F320C3 Boot block flash –32.
CSC190 Introduction to Computing Operating Systems and Utility Programs.
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.
Linux Development Lecture 7. Schedule Linux Root Filesystem.
Chapter 4 Software. Introduction Program: is a set of sequence instructions that tell the computer what to do. Software: is a collection of programs,
Implementation of Embedded OS
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Linux and Coldfusion MX Mid-Michigan Coldfusion User’s Group, Nov
CHAPTER 2 COMPUTER SOFTWARE. LEARNING OUTCOMES At the end of this class, students should be able to:  Explain the significance of software  Define and.
1 Embedded Linux Optimization © Copyright 2010, Marco Stornelli Creative Commons Attribution-ShareAlike 3.0 license 9/20/2016 Linux development Embedded.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Free Electrons Introduction.
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 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The GRUB bootloader Michael.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux system development.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com ELCE 2009 Update on boot time.
1 How to port GNU/Linux on your PDA © Copyright , Free Electrons, Creative Commons Attribution-ShareAlike license
Embedded Linux Wiki BOF. eLinux Wiki 2 Embedded Linux Wiki BOF Ottawa Linux Symposium June 2007 © 2007 Michael Opdenacker
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Scratchbox The Scratchbox.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Block filesystems Michael.
Michael Opdenacker Linux Tiny Linux-Tiny - The diet must go on Michael Opdenacker Free Electrons
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com ELC 2009 System Size BOF Michael.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Block filesystems Michael.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
By Ganesan Alagu Ganesh Feb 26, 2008
#FOSDEM Februari 4, 2017 brabo
Implementation of Embedded OS
Bare metal OS project CSSE 332 Operating Systems
Computer System Laboratory
CELF Embedded BOF - Ottawa - July 2008
By Ganesan Alagu Ganesh Feb 21, 2008
Implementation of Embedded OS
IM-pack: Software Installation Using Disk Images
Computer System Laboratory
CO6025 Advanced Programming
The blob bootloader Thomas Petazzoni Free Electrons
Penguin Weight Watchers
Embedded Linux Conference - April 2009
5 SYSTEM SOFTWARE CHAPTER
Washington University
IS3440 Linux Security Unit 7 Securing the Linux Kernel
5 SYSTEM SOFTWARE CHAPTER
Computer System Laboratory
Computer System Laboratory
Presentation transcript:

Ottawa Linux Symposium 2007 Tiny qemu arm system with a DirectFB interface Michael Opdenacker Free Electrons http://free-electrons.com Created with OpenOffice.org 2.2

Free embedded Linux training materials All the technical presentations and training materials created and used by Free Electrons, available under a free documentation license (more than 1500 pages!). http://free-electrons.com/training Introduction to Unix and GNU/Linux Embedded Linux kernel and driver development Free Software tools for embedded Linux systems Audio in embedded Linux systems Multimedia in embedded Linux systems http://free-electrons.com/articles Advantages of Free Software in embedded systems Embedded Linux optimizations Embedded Linux from Scratch... in 40 min! Linux USB drivers Real-time in embedded Linux systems Introduction to uClinux Linux on TI OMAP processors Free Software development tools Java in embedded Linux systems Introduction to GNU/Linux and Free Software Linux and ecology What's new in Linux 2.6? How to port Linux on a new PDA

Embedded Linux Wiki BOF

Demo features VersatilePB board emulated by qemu, 16 MB of RAM (needs at least 10 MB) Uses the uClibc C library (4x smaller than glic) DirectFB library and example programs Busybox: shell scripts and command line utilities Original size: 74 MB Size after optimization: 2.2 MB (kernel + rootfs) (31% of which is images!)

Built with Scratchbox http://scratchbox.org/ - A cross-compiling toolkit Makes it easier to cross-compile a complete embedded Linux system. A cornerstone of Nokia's Maemo development environment. Works by allowing tools to be cross-compiled in a transparent way, making building tools believe they are doing a native compile job. Supported platforms: arm, x86 Uses the qemu emulator to transparently run built target binaries. Experimental support for ppc, mips and cris.

Embedded Linux Optimizations Reducing system size

Removing unused files /usr/include (48 M), /usr/local/include (2.3M): C headers. /usr/local/share/man (236 K): manual pages. *.a library object files (13.2 M) and *la links to them: only needed for compiling. /usr/lib/libfakeroot (60 K), /usr/local/lib/pkgconfig (28K), /usr/bin/gdbserver, /usr/bin/strace (304 K): programs no longer needed in production. /usr/local/share/aclocal (14K): just needed for development.

Detecting unused libraries Run the readelf command from your cross-compiling toolchain on all your executables (ldd often not available) . It tells you which shared libraries are used. Remove the unused shared libraries Back to our example: /usr/lib/libstdc++.so.6.0.3 (2.4 M)

Automatic removal of unused files Implementation ideas: Mount the root filesystem with the atime option. Run your complete test suite Then, use the find command to identify files with an access time older than that of your first user-space program. Or implement that through a BusyBox applet. Drawback: has to be done on a real, read-write filesystem, if you are using a read-only filesystem like SquashFS. Of course, also takes care of detecting unused shared libraries.

Merging duplicate files Software compiling and installing often create duplicate files... Check that your root filesystem doesn’t contain any! dupmerge2: http://sourceforge.net/projects/dupmerge Replaces duplicate files by hard links. clink: http://free-electrons.com/community/tools/utils/clink Replaces duplicate files by symbolic links. Example: saves 4% of total space in Fedora Core 5. finddup: http://www.shelldorado.com/scripts/cmds/finddup Finds duplicate files.

sstrip: “super strip” http://muppetlabs.com/~breadbox/software/elfkickers.html Goes beyond strip and can strip out a few more bits that are not used by Linux to start an executable. Can be used on libraries too. Minor limitation: processed libraries can no longer be used to compile new executables. Can also be found in toolchains made by Buildroot (optional) Best for tiny executables!

Reducing the kernel size Using Linux-Tiny options (CONFIG_EMBEDDED) Removing printk, BUG, panic... Removing unused features like core dumps, etc. Who needs all features in a special purpose system? Using compiler optimizations for size. Compressed kernel size before: 632 KB Compressed kernel size after: 420 KB!

Using initramfs Booting on an root filesystem in an initramfs: Saves size: compressed cpio archive within the kernel. Just 1 file to handle in the bootloader. Simpler: no block driver, no filesystem driver (smaller kernel) Saves RAM compared to an init ramdisk Can also be used to carry non GPL files: firmware, pictures, proprietary drivers...

Embedded Linux Optimizations Reducing kernel boot time

Disable console output The output of kernel bootup messages to the console takes time! Even worse: scrolling up in framebuffer consoles! Console output not needed in production systems. Console output can be disabled with the quiet argument in the Linux kernel command line (bootloader settings) Example: root=/dev/ram0 rw init=/startup.sh quiet Benchmarks: can reduce boot time by 30 or even 50%! See http://elinux.org/Disable_Console

Preset loops_per_jiffy At each boot, the Linux kernel calibrates a delay loop (for the udelay function). This measures a loops_per_jiffy (lpj) value. This takes about 25 jiffies (1 jiffy = time between 2 timer interrupts). In embedded systems, it can be about 250 ms! You just need to measure this once! Find the lpj value in kernel boot messages (if you don't get it in the console, boot Linux with the loglevel=8 parameter). Example: Calibrating delay loop... 187.59 BogoMIPS (lpj=937984) At the next boots, start Linux with the below option: lpj=<value>

Techniques not used yet Library optimizer: http://libraryopt.sourceforge.net/ Removes unused symbols in shared libraries. LZMA SquashFS http://www.squashfs-lzma.org/ Puppies!

Thank you! Questions or suggestions? References http://elinux.org/ More specifically: http://elinux.org/System_Size http://elinux.org/Boot_Time http://free-electrons.com/articles/optimizations/ The demo, its sources and technical details can be found on: http://free-electrons.com/community/demos/qemu-arm-directfb/ Thank you! Questions or suggestions?