Book Image

Mastering Embedded Linux Programming

By : Chris Simmonds
Book Image

Mastering Embedded Linux Programming

By: Chris Simmonds

Overview of this book

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.
Table of Contents (22 chapters)
Mastering Embedded Linux Programming
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Getting the PREEMPT_RT patches


The RT developers do not create patch sets for every kernel version because of the amount of effort involved. On average, they create patches for every other kernel. The most recent kernels that are supported at the time of writing are as follows:

  • 4.1-rt

  • 4.0-rt

  • 3.18-rt

  • 3.14-rt

  • 3.12-rt

  • 3.10-rt

The patches are available at https://www.kernel.org/pub/linux/kernel/projects/rt.

If you are using the Yocto Project, there is an rt version of the kernel already. Otherwise, it is possible that the place you got your kernel from already has the PREEMPT_RT patch applied. Otherwise, you will have to apply the patch yourself. Firstly, make sure that the PREEMPT_RT patch version and your kernel version match exactly, otherwise you will not be able to apply the patches cleanly. Then you apply it in the normal way, as shown here:

$ cd linux-4.1.10
$ zcat patch-4.1.10-rt11.patch.gz | patch -p1

You will then be able to configure the kernel with CONFIG_PREEMPT_RT_FULL.

There is a problem...