Linux FastBoot. Reducing Embedded Linux Boot Times. Embedded World Conference 2012

Similar documents
U-Boot Falcon Mode. Minimizing boot times using U-Boot "Falcon" mode. Stefano Babic / Wolfgang Denk. July 2012

Boot time Optimization of Automotive Grade Linux. Shilu SL & Renjith G 14-Jul-2016

The Right Approach to Minimal Boot Times

Achieve Fastest System Startup Sequences.

Update on boot time reduction techniques

Android System Development Training 4-day session

Booting Linux Fast & Fancy. Embedded Linux Conference Europe Cambridge, Robert Schwebel

EMBEDDED LINUX ON ARM9 Weekend Workshop

Optimizing Linux Boot Time

Design Patterns for modular services, drivers and user land

Ottimizzare i tempi di boot di Linux. Andrea Righi -

Yocto Project and OpenEmbedded training 3-day session

Keystone ROM Boot Loader (RBL)

IPL+UBI: Flexible and Reliable with Linux as the Bootloader

Lesson 6 Intel Galileo and Edison Prototype Development Platforms. Chapter-8 L06: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Intel SoC FPGA Embedded Development Suite (SoC EDS) Release Notes

Micetek International Inc. Professional Supplier for PowerPC Development Tools

U-Boot bootloader port done right 2017 edition

ECE 471 Embedded Systems Lecture 16

Developing on DragonBoard

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

Fastboot Techniques for the x86 Architecture. Ben Biron QNX Software Systems

A pragmatic guide to boot-time optimization

Introduction to the Itron Riva Dev Kits

CSE 265: System and Network Administration

CSE 265: System and Network Administration

Introduction to Embedded Bootloader. Intel SSG/SSD/UEFI

Embedded Linux kernel and driver development training 5-day session

FreeBSD and Beaglebone Black, a robotic application.

UFCETW-20-2 Examination Answer all questions in Section A (60 marks) and 2 questions from Section B (40 marks)

TQ2440 Development Platform Manual

ARM Powered SoCs OpenEmbedded: a framework for toolcha. generation and rootfs management

The purpose of this course is to provide an introduction to the RL78's flash features and archectecture including security features, code and data

Embedded Linux Conference Europe Sascha Hauer

Introduction p. 1 Why Linux? p. 2 Embedded Linux Today p. 3 Open Source and the GPL p. 3 Free Versus Freedom p. 4 Standards and Relevant Bodies p.

Copyright 2016 Xilinx

10 Steps to Virtualization

Helping Developers Help You. Tom Caputi

NetBSD on Marvell Armada XP System on a Chip

Designing with ALTERA SoC Hardware

Lessons learnt in boot time reduction

HKG Android Verified Boot 2.0 and U-boot. Igor Opaniuk, Texas Instruments

Patrick Doyle Principal Software Engineer, irobot 2017 Embedded Linux Conference, Portland OR

What Operating Systems Do An operating system is a program hardware that manages the computer provides a basis for application programs acts as an int

Computer Fundamentals and Operating System Theory. By Neil Bloomberg Spring 2017

NFC NUTSHELL KIT. MCU Modules USER MANUAL REVISION GMMC GmbH Keywords Abstract. Document information

OM-Cube Project. Contents. V. Hiribarren - N. Marchand - N. Talfer OM-Cube Project 1. V. Hiribarren - N. Marchand - N. Talfer OM-Cube Project 2

I/O Devices. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

SheevaPlug Development Kit Reference Design. Rev 1.2

Hello, and welcome to this presentation of the STM32 Flash memory interface. It covers all the new features of the STM32F7 Flash memory.

Embedded Linux Architecture

Micetek International Inc. Professional Supplier for PowerPC Development Tools

Introducing StellarisWare

Overview for Axxia 5600 and Axxia 6700

Virtual Memory. Chapter 8

Linux. For BCT RE2G2. User Guide. Document Reference: BCTRE2G2 Linux User Guide. Document Issue: Associated SDK release: 1.

NS115 System Emulation Based on Cadence Palladium XP

How I survived to a SoC with a terrible Linux BSP

Porting Linux to a new SoC

UNIT 2. OPERATING SYSTEM STRUCTURES

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

How I survived to a SoC with a terrible Linux BSP

TEGRA LINUX DRIVER PACKAGE (R15.BETA)

Baltos ir Contact Online. More Pictures. Click on the thumbnails for the large picture

64 bit Bare Metal Programming on RPI-3. Tristan Gingold

This is the Memory Map section of the MIPS software training course.

S2C K7 Prodigy Logic Module Series

Porting U-Boot and Linux on new ARM boards: a step-by-step guide

Pushing The Limits Of Linux On ARM

Booting It Successfully For The First Time In Mainline

Background. Contiguous Memory Allocation

Release Notes for QNX Neutrino BSP for Renesas SH7785 SDK 1.0.0#

D1 - Embedded Linux. Building and installing an embedded and real-time Linux platform. Objectives. Course environment.

Embest SOC8200 Single Board Computer

OP-TEE Using TrustZone to Protect Our Own Secrets

Engineer-to-Engineer Note

Full Linux on FPGA. Sven Gregori

Hands-on with the Sitara Linux SDK

Kernel Boot-Time Optimization

ECE 471 Embedded Systems Lecture 15

Debian & Yocto: State of the Art

CompTIA Linux+/LPIC-1 COPYRIGHTED MATERIAL

RK3036 Kylin Board Hardware Manual V0.1

Mass-Storage Structure

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

UEFI and IoT: Best Practices in Developing IoT Firmware Solutions

Embedded Linux system development training 5-day session

Azure Sphere: Fitting Linux Security in 4 MiB of RAM. Ryan Fairfax Principal Software Engineering Lead Microsoft

Chapter 4. Enhancing ARM7 architecture by embedding RTOS

CS 410/510. Mark P Jones Portland State University

HOW TO INTEGRATE NFC FRONTENDS IN LINUX

Chapter 3: Operating-System Structures

Linuxboot continuous integration

CS 31: Intro to Systems Caching. Kevin Webb Swarthmore College March 24, 2015

ECE 471 Embedded Systems Lecture 16

U-Boot and Linux Kernel Debug using CCSv5

The Early System Start-Up Process. Group Presentation by: Tianyuan Liu, Caiwei He, Krishna Parasuram Srinivasan, Wenbin Xu

Dynamic Memory Allocation

ECE 471 Embedded Systems Lecture 12

Titan silicon root of trust for Google Cloud

Transcription:

Linux FastBoot Reducing Embedded Linux Boot Times Embedded World Conference 2012 Michael Röder Future Electronics Deutschland GmbH Detlev Zundel DENX Software Engineering GmbH

Agenda Optimization Basics and Principles Boot Process Analysis and Profiling Techniques Optimization of Kernel-Space User-Space U-Boot History and Introduction Using U-Boot s SPL for Fastboot

System Boot Process Cold-Start-Time := Time from Power-On to First-Available Use Various stages involved: - hardware-setup (clocks, memories, initialization) - boot loader (device initialization, kernel decompression) - kernel init - user init / application start time Time wasted due to - probing (unneeded flexibility) - redundant tasks - unnecessary tasks - debugging functionality (keep a separate setup for debugging)

Optimization Basics Analysis before Optimization Premature optimization is the root of all evil. [ ] A good programmer [ ] will be wise to look care fully at the critical code; but only after that code has been identified: (Donald Knuth) Take a step-by-step approach, verify results and detect possible undesired implications after each step Optimize big chunks first: t 1 =8s; t 2 =2s; speed-up by factor 4 of t 1 = 1/4 * 8s = 2s => total speedup: 150%. speed-up by factor 4 of t 2 = 1/4 * 2s = 0.5s => total speedup: 17%

Understanding the Application First-Available-Use - the point of time in which the system feels ready to the user => is in the eye of the beholder - partially available system is often enough for first steps - less urgent tasks can be postponed or partial unavailability be hidden from user Understanding APPLICATION (<=> Realization) is critical - when do ressources / functionality really have to be available? - dependencies on each other - BDD-like dependency tree shows potential for removal, parallelization and deferring (see next slide!) No rules-of-thumb, each application is different!!!

Optimization Principles (1) Don t do it at all leave out all unnecessary functionality optimize for the current specification, not for future plans, ideas, extendability, (2) Do it faster hardware is known => remove probing, scanning use hardware specific compiler optimizations remove unneeded functionality and flexibility make the common case fast (3) Do it in parallel (for independent tasks) dependency diagram (previous slide) will show possiblities (4) Do it later when nobody notices, after First-Available-Use has been reached

Boot Process Analysis and Profiling Host-Based Measurement Methods - no modifications or performance implications on target - serial console with time-stamping terminal software time_log, grabserial or RealTerm use keywords to trigger / reset time upon events of interest - GPIO-toggling based methods Target-Based Methods - enable kernel timestamps (printk.time=1) - module_init_call tracing (initcall_debug) use bootgraph.pl on host to generate bootgraph great to verify / document improvements

Kernel Optimization Basis for Analysis: graph generated by bootgraph.pl Kernel Configuration - remove all debugging functionality - remove unnecessary device drivers - remove device drivers only needed after First-Available-Use (and load those later in the background using modprobe) Driver Configuration - preset information and remove probing whereever possible - re-use information from the bootloader (FDT, boot parameters) analyze driver init routine for long delay loops - call those init routines earlier (e.g. from the boot loader) - arrange such init routines in parallel

User-Space Optimization Combine all init scripts into a single one - remove unused and unrequired services - optimize remaining services remove sanity checks, log-file creation preset information wherever possible to avoid searching/probing - move everything not necessary for First-Available-Use to a separate script and start later (from application/cron) Avoid using udev - use mknod or a copy of the complete /dev tree instead - if hotplugging is required, enable devtmpfs For profiling use echo tag > /dev/kmsg (with timestamping serial console software)

U-Boot Started as a simple boot loader with network support for PowerPC Grew into multi-platform boot loader, supporting 14 architectures Wide support for mass storage, i.e. NOR, NAND, SPI-NOR, MMC, PATA, SATA Supports advanced peripherals like PCI, USB, etc. Powerful scripting capabilities Also used for hardware bring-up Can adapt to software development phases

U-Boot SPL Classic CPUs start execution by fetching instructions directly over the address and data buses, i.e. ROM or NOR-Flash Modern storage devices cannot be attached directly and need special access methods, i.e. NAND is attached serially and needs page-wise accesses A CPU booting from one of these media can usually only load and start a single block of storage SPL of U-Boot was designed to re-use existing drivers and be such a small Secondary Program Loader

Using SPL for FastBoot Flexibility of U-Boot shows in memory footprint, several 100 kb are no exception Loading U-Boot itself becomes significant for execution time SPL framework allows to split U-Boot into mimimum necessary part to access storage - and - the rest This rest can be just another payload, comparable to the Linux kernel Two scenarios: Fast path : SPL loads and then starts Linux kernel Development or maintenance mode : SPL loads U-Boot

Building SPL Mostly manual process comparable to normal U-Boot configuration through header file If SPL is supported on target architecture: start with #define CONFIG_SPL add necessary drivers, i.e. CONFIG_SPL_NAND_SUPPORT, etc. fill in blanks and control logic, i.e. payload switching and loading (e.g. spl_board_prepare_for_linux() ) Resulting SPL is only several kb

Linux as Payload Patches only entering mainline, so the design is still in flux and may change in the future Usually U-Boots fixes up parameters passed to the Linux kernel, i.e. the flat device tree #define CONFIG_CMD_SPL compiles U-Boot command capable of capturing the result of this pre-processing This paramter block is frozen in a live system using regular U-Boot and is then used as an opaque block by SPL loader

Putting it all together In a properly configured system this is the fast path: - CPU loads SPL - SPL loads Linux kernel and paramter block - Linux boots When defined criteria holds, this is the development path: - CPU loads SPL - SPL loads U-Boot as payload - U-Boot command line starts - U-Boot can boot Linux as regular

Summary Boot Time Optimization is not... an automatic (or automatable) process black magic or an art Road to Success: Thorough Analysis: understand the desired application ( Specification ) analyze existing implementation / system Attentive Optimization remove unnecessary parts optimize the rest, to the extent that the specification permits start with the big and easy parts Enable Re-Use document and verify all changes made during the optimization process, especially possible implications on expected functionality document successes and failures of evaluated optimization attempts, take the same route for similar projects and hardware

THANK YOU