Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Embedded Linux Development
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Embedded Linux Development

Mastering Embedded Linux Development

By : Frank Vasquez, Mr. Chris Simmonds
close
close
Mastering Embedded Linux Development

Mastering Embedded Linux Development

By: Frank Vasquez, Mr. Chris Simmonds

Overview of this book

Mastering Embedded Linux Development' is designed to be both a learning resource and a reference for your embedded Linux projects. The book starts by breaking down the fundamental elements that underpin all embedded Linux projects: the toolchain, the bootloader, the kernel, and the root filesystem. First, you will download and install a pre-built toolchain. After that, you will cross-compile each of the remaining three elements from scratch and learn to automate the process using Buildroot and the Yocto Project. The book progresses with coverage of over-the-air software updates and rapid prototyping with add-on boards. Two new chapters tackle modern development practices including Python packaging and deploying containerized applications. These are followed by a chapter on writing multithreaded code and another on techniques to manage memory in an efficient way. The final chapters demonstrate how to debug your code, whether it resides in user space or in the Linux kernel itself. In addition to GDB, the book also covers the different tracers and profilers that are available for Linux so that you can quickly pinpoint any performance bottlenecks in your system. By the end of this book, you will be able to create efficient and secure embedded devices with Linux that will delight your users.
Table of Contents (28 chapters)
close
close
1
Part 1: Elements of Embedded Linux
7
Part 2: Building Embedded Linux Images
11
Part 3: System Architecture and Design Decisions
18
Part 4: Developing Applications
23
Part 5: Debugging and Optimizing Performance

Navigating open source

The components of embedded Linux are open source so now is a good time to consider what that means, why open source licenses work the way they do, and how this affects the often proprietary embedded device you will be creating from it.

Licenses

When talking about open source the word free is often used. People new to the subject often take it to mean nothing to pay and open source software licenses do indeed guarantee that you can use the software to develop and deploy systems for no charge. However, the more important meaning here is freedom since you are free to obtain the source code, modify it in any way you see fit, and redeploy it in other systems. Open source licenses give you this right, but some also require you to share these changes with the public.

Compare that with freeware licenses, which allow you to copy the binaries for no cost but do not give you the source code. Other licenses allow you to use the software for free under certain circumstances, for example, for personal use, but not commercial. These are not open source.

I will provide the following comments in the interest of helping you understand the implications of working with open source licenses, but I would like to point out that I am an engineer and not a lawyer. What follows is my understanding of the licenses and how they are interpreted.

Open source licenses fall broadly into two categories:

  • Copyleft licenses such as the GNU General Public License (GPL)
  • Permissive licenses such as the BSD and MIT licenses

The permissive licenses say, in essence, that you may modify the source code and use it in systems of your own choosing as long as you do not modify the terms of the license in any way. In other words, apart from that one restriction, you can do with it what you want, including building it into possibly proprietary systems.

The GPL licenses are similar but have clauses that compel you to pass the rights to obtain and modify the software on to your end users. In other words, you share your source code. One option is to make it completely public by putting it onto a public server. Another is to offer it only to your end users by means of a written offer to provide the code when requested.

The GPL goes further to say that you cannot incorporate GPL code into proprietary programs. Any attempt to do so would make the GPL apply to the whole. In other words, you cannot combine GPL and proprietary code in the same program. Aside from the Linux kernel, the GNU Compiler Collection and GNU Debugger, as well as many other freely available tools associated with the GNU project, fall under the umbrella of the GPL.

So, what about libraries? If they are licensed with the GPL, any program linked with them becomes GPL also. However, most libraries are licensed under the GNU Lesser General Public License (LGPL). If this is the case, you are allowed to link with them from a proprietary program.

IMPORTANT NOTE

All of the preceding descriptions relate specifically to the GPL v2 and LGPL v2. I should mention the latest versions of the GPL v3 and LGPL v3. These are controversial and I will admit that I don’t fully understand the implications. However, the intention is to ensure that the GPL v3 and LGPL v3 components in any system can be replaced by the end user, which is in the spirit of open source software for everyone.

The GPL v3 and LGPL v3 have their problems though. There are security issues. If the owner of a device has access to the system code, then so might an unwelcome intruder. Often the defense is to have kernel images signed by an authority such as the vendor so that unauthorized updates are not possible. Is that an infringement of my right to modify my device? Opinions differ.

IMPORTANT NOTE

The TiVo set-top box is an important part of this debate. It uses a Linux kernel, which is licensed under the GPL v2. TiVo has released the source code of their version of the kernel in compliance with the license. TiVo also has a bootloader that will only load a kernel binary that is signed by them. Consequently, you can build a modified kernel for a TiVo box, but you cannot load it on the hardware.

The Free Software Foundation (FSF) takes the position that this is not in the spirit of open source software and refers to this procedure as tivoization. The GPL v3 and LGPL v3 were written explicitly to prevent this from happening. Some projects, the Linux kernel in particular, have been reluctant to adopt the GPL version 3 licenses because of the restrictions they place on device manufacturers.

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY