Book description
Leverage the power of Linux to develop captivating and powerful embedded Linux projects
About This Book
Explore the best practices for all embedded product development stages
Learn about the compelling features offered by the Yocto Project, such as customization, virtualization, and many more
Minimize project costs by using open source tools and programs
Who This Book Is For
If you are a developer who wants to build embedded systems using Linux, this book is for you. It is the ideal guide for you if you want to become proficient and broaden your knowledge. A basic understanding of C programming and experience with systems programming is needed. Experienced embedded Yocto developers will find new insight into working methodologies and ARM specific development competence.
What You Will Learn
Use the Yocto Project in the embedded Linux development process
Get familiar with and customize the bootloader for a board
Discover more about real-time layer, security, virtualization, CGL, and LSB
See development workflows for the U-Boot and the Linux kernel, including debugging and optimization
Understand the open source licensing requirements and how to comply with them when cohabiting with proprietary programs
Optimize your production systems by reducing the size of both the Linux kernel and root filesystems
Understand device trees and make changes to accommodate new hardware on your device
Design and write multi-threaded applications using POSIX threads
Measure real-time latencies and tune the Linux kernel to minimize them
In Detail
Embedded Linux is a complete Linux distribution employed to operate embedded devices such as smartphones, tablets, PDAs, set-top boxes, and many more. An example of an embedded Linux distribution is Android, developed by Google.
This learning path starts with the module Learning Embedded Linux Using the Yocto Project. It introduces embedded Linux software and hardware architecture and presents information about the bootloader. You will go through Linux kernel features and source code and get an overview of the Yocto Project components available.
The next module Embedded Linux Projects Using Yocto Project Cookbook takes you through the installation of a professional embedded Yocto setup, then advises you on best practices. Finally, it explains how to quickly get hands-on with the Freescale ARM ecosystem and community layer using the affordable and open source Wandboard embedded board.
Moving ahead, the final module Mastering Embedded Linux Programming takes you through the product cycle and gives you an in-depth description of the components and options that are available at each stage. You will see how functions are split between processes and the usage of POSIX threads.
By the end of this learning path, your capabilities will be enhanced to create robust and versatile embedded projects.
This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products:
Learning Embedded Linux Using the Yocto Project by Alexandru Vaduva
Embedded Linux Projects Using Yocto Project Cookbook by Alex González
Mastering Embedded Linux Programming by Chris Simmonds
Style and approach
This comprehensive, step-by-step, pragmatic guide enables you to build custom versions of Linux for new embedded systems with examples that are immediately applicable to your embedded developments. Practical examples provide an easy-to-follow way to learn Yocto project development using the best practices and working methodologies. Coupled with hints and best practices, this will help you understand embedded Linux better.
Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.
Table of contents
-
Linux: Embedded Development
- Table of Contents
- Linux: Embedded Development
- Linux: Embedded Development
- Credits
- Preface
-
1. Module 1
- 1. Introduction
- 2. Cross-compiling
- 3. Bootloaders
- 4. Linux Kernel
- 5. The Linux Root Filesystem
- 6. Components of the Yocto Project
- 7. ADT Eclipse Plug-ins
- 8. Hob, Toaster, and Autobuilder
- 9. Wic and Other Tools
- 10. Real-time
- 11. Security
- 12. Virtualization
- 13. CGL and LSB
-
2. Module 2
-
1. The Build System
- Introduction
- Setting up the host system
- Installing Poky
- Creating a build directory
- Building your first image
- Explaining the Freescale Yocto ecosystem
- Installing support for Freescale hardware
- Building Wandboard images
- Troubleshooting your Wandboard's first boot
- Configuring network booting for a development setup
- Sharing downloads
- Sharing the shared state cache
- Setting up a package feed
- Using build history
- Working with build statistics
- Debugging the build system
-
2. The BSP Layer
- Introduction
- Creating a custom BSP layer
- Introducing system development workflows
- Adding a custom kernel and bootloader
- Explaining Yocto's Linux kernel support
- Describing Linux's build system
- Configuring the Linux kernel
- Building the Linux kernel
- Building external kernel modules
- Debugging the Linux kernel and modules
- Debugging the Linux kernel booting process
- Using the kernel function tracing system
- Managing the device tree
- Debugging device tree issues
-
3. The Software Layer
- Introduction
- Exploring an image's contents
- Adding a new software layer
- Selecting a specific package version and providers
- Adding supported packages
- Adding new packages
- Adding data, scripts, or configuration files
- Managing users and groups
- Using the sysvinit initialization manager
- Using the systemd initialization manager
- Installing package-installation scripts
- Reducing the Linux kernel image size
- Reducing the root filesystem image size
- Releasing software
- Analyzing your system for compliance
- Working with open source and proprietary code
-
4. Application Development
- Introduction
- Preparing and using an SDK
- Using the Application Development Toolkit
- Using the Eclipse IDE
- Developing GTK+ applications
- Using the Qt Creator IDE
- Developing Qt applications
- Describing workflows for application development
- Working with GNU make
- Working with the GNU build system
- Working with the CMake build system
- Working with the SCons builder
- Developing with libraries
- Working with the Linux framebuffer
- Using the X Windows system
- Using Wayland
- Adding Python applications
- Integrating the Oracle Java Runtime Environment
- Integrating the Open Java Development Kit
- Integrating Java applications
-
5. Debugging, Tracing, and Profiling
- Introduction
- Analyzing core dumps
- Native GDB debugging
- Cross GDB debugging
- Using strace for application debugging
- Using the kernel's performance counters
- Using static kernel tracing
- Using dynamic kernel tracing
- Using dynamic kernel events
- Exploring Yocto's tracing and profiling tools
- Tracing and profiling with perf
- Using SystemTap
- Using OProfile
- Using LTTng
- Using blktrace
-
1. The Build System
-
3. Module 3
- 1. Starting Out
-
2. Learning About Toolchains
- What is a toolchain?
- Types of toolchain - native versus cross toolchain
- Choosing the C library
- Finding a toolchain
- Anatomy of a toolchain
- Other tools in the toolchain
- Looking at the components of the C library
- Linking with libraries: static and dynamic linking
- The art of cross compiling
- Problems with cross compiling
- Summary
- 3. All About Bootloaders
- 4. Porting and Configuring the Kernel
-
5. Building a Root Filesystem
- What should be in the root filesystem?
- Programs for the root filesystem
- Libraries for the root filesystem
- Device nodes
- The proc and sysfs filesystems
- Kernel modules
- Transfering the root filesystem to the target
- Creating a boot ramdisk
- The init program
- Configuring user accounts
- Starting a daemon process
- A better way of managing device nodes
- Configuring the network
- Creating filesystem images with device tables
- Mounting the root filesystem using NFS
- Using TFTP to load the kernel
- Additional reading
- Summary
- 6. Selecting a Build System
-
7. Creating a Storage Strategy
- Storage options
- Accessing flash memory from the bootloader
- Accessing flash memory from Linux
- Filesystems for flash memory
- Filesystems for NOR and NAND flash memory
- Filesystems for managed flash
- Read-only compressed filesystems
- Temporary filesystems
- Making the root filesystem read-only
- Filesystem choices
- Updating in the field
- Further reading
- Summary
- 8. Introducing Device Drivers
- 9. Starting up - the init Program
- 10. Learning About Processes and Threads
- 11. Managing Memory
- 12. Debugging with GDB
- 13. Profiling and Tracing
-
14. Real-time Programming
- What is real-time?
- Identifying the sources of non-determinism
- Understanding scheduling latency
- Kernel preemption
- The real-time Linux kernel (PREEMPT_RT)
- Threaded interrupt handlers
- Preemptible kernel locks
- Getting the PREEMPT_RT patches
- High resolution timers
- Avoiding page faults in a real-time application
- Interrupt shielding
- Measuring scheduling latencies
- Further reading
- Summary
- A. Bibliography
- Index
Product information
- Title: Embedded Linux for Developers
- Author(s):
- Release date: September 2016
- Publisher(s): Packt Publishing
- ISBN: 9781787124202
You might also like
book
Embedded Linux Systems with the Yocto Project
Build Complete Embedded Linux Systems Quickly and Reliably Developers are increasingly integrating Linux into their embedded …
book
Embedded Linux Development using Yocto Projects - Second Edition
Optimize and boost your Linux-based system with Yocto Project and increase its reliability and robustness efficiently …
book
Linux Sound Programming
Program audio and sound for Linux using this practical, how-to guide. You will learn how to …
book
Building Embedded Linux Systems, 2nd Edition
There's a great deal of excitement surrounding the use of Linux in embedded systems -- for …