Book description
Harness the power of Linux to create versatile and robust embedded solutions
About This Book
- Create efficient and secure embedded devices using Linux
- Minimize project costs by using open source tools and programs
- Explore each component technology in depth, using sample implementations as a guide
Who This Book Is For
This book is ideal for Linux developers and system programmers who are already familiar with embedded systems and who want to know how to create best-in-class devices. A basic understanding of C programming and experience with systems programming is needed.
What You Will Learn
- Understand the role of the Linux kernel and select an appropriate role for your application
- Use Buildroot and Yocto to create embedded Linux systems quickly and efficiently
- Create customized bootloaders using U-Boot
- Employ perf and ftrace to identify performance bottlenecks
- Understand device trees and make changes to accommodate new hardware on your device
- Write applications that interact with Linux device drivers
- Design and write multi-threaded applications using POSIX threads
- Measure real-time latencies and tune the Linux kernel to minimize them
In Detail
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 begin by learning about toolchains, bootloaders, the Linux kernel, and how to configure a root filesystem to create a basic working device. You will then learn how to use the two most commonly used build systems, Buildroot and Yocto, to speed up and simplify the development process. Building on this solid base, the next section considers how to make best use of raw NAND/NOR flash memory and managed flash eMMC chips, including mechanisms for increasing the lifetime of the devices and to perform reliable in-field updates. Next, you need to consider what techniques are best suited to writing applications for your device. We will then see how functions are split between processes and the usage of POSIX threads, which have a big impact on the responsiveness and performance of the final device The closing sections look at the techniques available to developers for profiling and tracing applications and kernel code using perf and ftrace.
Style and approach
This book is an easy-to-follow and pragmatic guide consisting of an in-depth analysis of the implementation of embedded devices. Each topic has a logical approach to it; this coupled with hints and best practices helps you understand embedded Linux better.
Table of contents
-
Mastering Embedded Linux Programming
- Table of Contents
- Mastering Embedded Linux Programming
- Credits
- Foreword
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 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
- Index
Product information
- Title: Mastering Embedded Linux Programming
- Author(s):
- Release date: December 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784392536
You might also like
book
Mastering Embedded Linux Programming - Second Edition
Master the techniques needed to build great, efficient embedded devices on Linux About This Book Discover …
book
Mastering Embedded Linux Programming - Third Edition
Harness the power of Linux to create versatile and robust embedded solutions Key Features Learn how …
book
Hands-On System Programming with Linux
Get up and running with system programming concepts in Linux Key Features Acquire insight on Linux …
book
Linux System Programming, 2nd Edition
Write software that draws directly on services offered by the Linux kernel and core system libraries. …