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

Embedded Linux Development Using Yocto Project Cookbook - Second Edition

Alex Gonzalez, Javier Viguera

Compartir libro
  1. 456 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Embedded Linux Development Using Yocto Project Cookbook - Second Edition

Alex Gonzalez, Javier Viguera

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Embedded Linux Development Using Yocto Project Cookbook - Second Edition un PDF/ePUB en línea?
Sí, puedes acceder a Embedded Linux Development Using Yocto Project Cookbook - Second Edition de Alex Gonzalez, Javier Viguera en formato PDF o ePUB, así como a otros libros populares de Computer Science y Operating Systems. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781788392921
Edición
2

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...

Índice