Embedded Linux Development Using Yocto Project Cookbook - Second Edition
eBook - ePub

Embedded Linux Development Using Yocto Project Cookbook - Second Edition

Alex Gonzalez, Javier Viguera

Buch teilen
  1. 456 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Embedded Linux Development Using Yocto Project Cookbook - Second Edition

Alex Gonzalez, Javier Viguera

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Over 79 hands-on recipes for professional embedded Linux developers to optimize and boost their Yocto Project know-howAbout This Book• Optimize your Yocto setup to speed up development and debug build issues• Use what is quickly becoming the standard embedded Linux product builder framework—the Yocto Project• Recipe-based implementation of best practices to optimize your Linux systemWho This Book Is ForIf you are an embedded Linux developer with the basic knowledge of Yocto Project, this book is an ideal way to broaden your knowledge with recipes for embedded development.What You Will Learn• Optimize your Yocto Project setup to speed up development and debug build issues• Use Docker containers to build Yocto Project-based systems• Take advantage of the user-friendly Toaster web interface to the Yocto Project build system• Build and debug the Linux kernel and its device trees• Customize your root filesystem with already-supported and new Yocto packages• Optimize your production systems by reducing the size of both the Linux kernel and root filesystems• Explore the mechanisms to increase the root filesystem security• Understand the open source licensing requirements and how to comply with them when cohabiting with proprietary programs• Create recipes, and build and run applications in C, C++, Python, Node.js, and JavaIn DetailThe Yocto Project has become the de facto distribution build framework for reliable and robust embedded systems with a reduced time to market.You'll get started by working on a build system where you set up Yocto, create a build directory, and learn how to debug it. Then, you'll explore everything about the BSP layer, from creating a custom layer to debugging device tree issues. In addition to this, you'll learn how to add a new software layer, packages, data, scripts, and configuration files to your system. You will then cover topics based on application development, such as using the Software Development Kit and how to use the Yocto project in various development environments. Toward the end, you will learn how to debug, trace, and profile a running system. This second edition has been updated to include new content based on the latest Yocto release.Style and approachThis recipe-based book will guide you through all the development stages of an embedded Linux product design using the Yocto Project.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Embedded Linux Development Using Yocto Project Cookbook - Second Edition als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Embedded Linux Development Using Yocto Project Cookbook - Second Edition von Alex Gonzalez, Javier Viguera im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Operating Systems. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2018
ISBN
9781788392921

Application Development

In this chapter, we will cover the following recipes:
  • Introducing toolchains
  • Preparing an SDK
  • Using the extensible SDK
  • 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 a web browser application
  • Adding Python applications
  • Integrating the Open Java Development Kit
  • Integrating Java applications
  • Integrating Node.js applications
  • Running Docker application containers

Introduction

Dedicated applications are what define an embedded product and Yocto offers helpful application development tools, as well as the functionality to integrate with popular Integrated Development Environments (IDE) such as Eclipse and Qt Creator. It also provides a wide range of utility classes to help in the integration of finished applications into the build system and target images. A normal embedded Linux software development team is logically divided into the following roles:
  • BSP developers in charge of the Board Support Package, which is the bootloader and Linux kernel. This team has the greatest exposure to the hardware. As we have seen in Chapter 2, The BSP layer, BSP development uses primarily the Yocto SDK.
  • Application developers will work on the Linux user space applications that define the product, including user interfaces. Developing applications for embedded Linux is not that different from developing applications for a Linux server or desktop, as the kernel abstracts most of the embedded device particularities. Application developers will also use the Yocto SDK to develop their applications.
  • System integrators who release an SDK for the other teams to use and integrate both the applications and BSP changes into the Yocto build system. They also create the final product images.
In summary, the Yocto SDK is the interface between the Yocto Project, BSP and application developers and allows the work of the different developers to be shared and developed simultaneously. Some teams have the same engineers covering all roles, while some others prefer to specialize. This chapter will introduce the Yocto SDK, an important component on the application development workflow when using the Yocto Project. The SDK contains the cross-compilation toolchain, but also the header files and libraries used to cross-compile root filesystem applications. We will also introduce IDEs and show how they are used to build and debug C and C++ applications on real hardware and will explore application development, including graphical frameworks and Yocto integration, not only for C and C++ but also other languages.

Introducing toolchains

A toolchain is a set of tools, binaries, and libraries used to build applications to run on a computer platform. In Yocto, the default toolchains are based on GNU components with GPL licenses.

Getting ready

A GNU toolchain contains the following components:
  • Assembler (GNU as): This is part of the binutils package
  • Linker (GNU ld): This is also part of the binutils package
  • Compiler (GNU gcc): Latest versions have support for C, C++, Java, Ada, Fortran, Go, and Objective C/C++
  • Debugger (GNU gdb): This is the GNU debugger
  • Binary file tools (objdump, nm, objcopy, readelf, strip, and so on): These are part of the binutils package.
These components are enough to build bare-metal applications, bootloaders like U-Boot, or operating systems like the Linux kernel, as they don't need a C library and they implement the C library functions they need. However, for Linux user space applications, a POSIX-compliant C library is needed. The GNU C library, glibc, is the default C library used in the Yocto Project, and musl, a smaller C library, is a supported alternative popular for resource-constrained devices. On embedded systems, it is not just a toolchain we need, but a cross-compilation toolchain. This is because we build in a host computer but run the resulting binaries on the target, which is usually a different architecture. In reality, there are several types of toolchain, based on the architecture of the machine building the toolchain (build machine), running the toolchain (host machine), and running the binaries built by the toolchain (target machine). The most common combinations are:
  • Native: An example of this is an x86 machine running a toolchain that has also been built on an x86 machine producing binaries to run on an x86 machine. This is common in desktop computers.
  • Cross-compilation: This is the most common on embedded systems; for example, an x86 machine running a toolchain that has also been built on an x86 machine but producing binaries to run on a different architecture, like ARM.
  • Cross-native: This is typically the toolchain running on targets. An example of this is where a toolchain has been built on an x86 machine but runs on ARM and produces binaries for ARM.
  • Canadian: This is rarely seen and is where the build, host, and target machines are all different.
The process of building a cross-compilation toolchain is complex and fault-prone, so automated tools for toolchain building have emerged, like crosstool-NG. The Yocto build system also compiles its own toolchain on every bui...

Inhaltsverzeichnis