Enter your mobile number below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
Getting the download link through email is temporarily not available. Please check back later.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your mobile phone number.

Embedded Linux Primer: A Practical Real-World Approach 1st Edition

4.7 out of 5 stars 19 customer reviews
ISBN-13: 978-0131679849
ISBN-10: 0131679848
Why is ISBN important?
This bar-code number lets you verify that you're getting exactly the right version or edition of a book. The 13-digit and 10-digit formats both work.
Scan an ISBN with your phone
Use the Amazon App to scan ISBNs and compare prices.
Have one to sell? Sell on Amazon
More Buying Choices
12 New from $27.09 27 Used from $1.99
Free Two-Day Shipping for College Students with Prime Student Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student

ITPro.TV Video Training
Take advantage of IT courses online anywhere, anytime with ITPro.TV. Learn more.
click to open popover

Editorial Reviews

About the Author

Christopher Hallinan is currently field applications engineer for Monta Vista Software, living and working in Massachusetts. Chris has spent more than 25 years in the networking and communications marketplace mostly in various product development roles, where he developed a strong background in the space where hardware meets software. Prior to joining Monta Vista, Chris spent four years as an independent Linux consultant providing custom Linux board ports, device drivers, and bootloaders. Chris’s introduction to the open source community was through contributions to the popular U-Boot bootloader. When not messing about with Linux, he is often found singing and playing a Taylor or Martin.

Excerpt. © Reprinted by permission. All rights reserved.

Embedded Linux Primer

Embedded Linux Primer


Although many good books cover Linux, none brings together so many dimensions of information and advice specifically targeted to the embedded Linux developer. Indeed, there are some very good books written about the Linux kernel, Linux system administration, and so on. You will find references right here in this book to many of the ones that I consider to be at the top of their categories.

Much of the material presented in this book is motivated by questions I've received over the years from development engineers, in my capacity as an embedded Linux consultant and my present role as a Field Application Engineer for Monta Vista Software, the leading vendor of embedded Linux distributions.

Embedded Linux presents the experienced software engineer with several unique challenges. First, those with many years of experience with legacy real-time operating systems (RTOSes) find it difficult to transition their thinking from those environments to Linux. Second, experienced application developers often have difficulty understanding the relative complexities of a cross-development environment.

Although this is a primer, intended for developers new to embedded Linux, I am confident that even developers who are experienced in embedded Linux will find some useful tips and techniques that I have learned over the years.

Practical Advice for the Practicing Embedded Developer

This book contains my view of what an embedded engineer needs to know to get up to speed fast in an embedded Linux environment. Instead of focusing on Linux kernel internals, the kernel chapter in this book focuses on the project nature of the kernel and leaves the internals to the other excellent texts on the subject. You will learn the organization and layout of the kernel source tree. You will discover the binary components that make up a kernel image, and how they are loaded and what purpose they serve on an embedded system. One of my favorite figures in the book is Figure 5-1, which schematically illustrates the build process of a composite kernel image.

In the pages of this book, you will learn how the build system works and how to incorporate into the Linux kernel your own custom changes that are required for your own projects. You will discover the mechanism used to drive the configuration of different architectures and features within the Linux kernel source tree and, more important, how to modify this system to customize it to your own requirements. We also cover in detail the kernel command-line mechanism. You will learn how it works, how to configure the kernel's runtime behavior for your requirements, and how to extend this functionality to your own project. You will learn how to navigate the kernel source code and how to configure the kernel for specific tasks related to an embedded system. You will learn many useful tips and tricks for your embedded project, from bootloaders, system initialization, file systems, and Flash memory to advanced kernel- and application-debugging techniques.

Intended Audience

This book is intended for programmers with a working knowledge of programming in C. I assume that you have a rudimentary understanding of local area networks and the Internet. You should understand and recognize an IP address and how it is used on a simple local area network. I also assume that you have an understanding of hexadecimal and octal numbering systems, and their common usage in a text such as this.

Several advanced concepts related to C compiling and linking are explored, so you will benefit from having at least a cursory understanding of the role of the linker in ordinary C programming. Knowledge of the GNU make operation and semantics will also prove beneficial.

What This Book Is Not

This book is not a detailed hardware tutorial. One of the difficulties the embedded developer faces is the huge variety of hardware devices in use today. The user manual for a modern 32-bit processor with some integrated peripherals can easily exceed 1,000 pages. There are no shortcuts. If you need to understand a hardware device from a programmer's point of view, you will need to spend plenty of hours in your favorite reading chair with hardware data sheets and reference guides, and many more hours writing and testing code for these hardware devices!

This is also not a book about the Linux kernel or kernel internals. In this book, you won't learn about the intricacies of the Memory Management Unit (MMU) used to implement Linux's virtual memory-management policies and procedures; there are already several good books on this subject. You are encouraged to take advantage of the "Suggestions for Additional Reading" section found at the end of every chapter.

Conventions Used

Filenames and code statements are presented in Courier. Commands issued by the reader are indicated in bold Courier. New terms or important concepts are presented in italics.

When you see a pathname preceded with three dots, this references a well-known but unspecified top-level directory. The top-level directory is context dependent but almost universally refers to a top-level Linux source directory. For example, .../arch/ppc/kernel/setup.c refers to the setup.c file located in the architecture branch of a Linux source tree. The actual path might be something like ~/sandbox/linux.2.6.14/arch/ppc/kernel/setup.c.

Organization of the Book

Chapter 1, "Introduction," provides a brief look at the factors driving the rapid adoption of Linux in the embedded environment. Several important standards and organizations relevant to embedded Linux are introduced.

Chapter 2, "Your First Embedded Experience," introduces the reader to many concepts related to embedded Linux upon which we build in later chapters.

In Chapter 3, "Processor Basics," we present a high-level look at the more popular processors and platforms that are being used to build embedded Linux systems. We examine selected products from many of the major processor manufacturers. All of the major architecture families are represented.

Chapter 4, "The Linux Kernel—A Different Perspective," examines the Linux kernel from a slightly different perspective. Instead of kernel theory or internals, we look at its structure, layout, and build construction so you can begin to learn your way around this large software project and, more important, learn where your own customization efforts must be focused. This includes detailed coverage of the kernel build system.

Chapter 5, "Kernel Initialization," details the Linux kernel's initialization process. You will learn how the architecture- and bootloader-specific image components are concatenated to the image of the kernel proper for downloading to Flash and booting by an embedded bootloader. The knowledge gained here will help you customize the Linux kernel to your own embedded application requirements.

Chapter 6, "System Initialization," continues the detailed examination of the initialization process. When the Linux kernel has completed its own initialization, application programs continue the initialization process in a predetermined manner. Upon completing Chapter 6, you will have the necessary knowledge to customize your own userland application startup sequence.

Chapter 7, "Bootloaders," is dedicated to the booloader and its role in an embedded Linux system. We examine the popular open-source bootloader U-Boot and present a porting example. We briefly introduce additional bootloaders in use today so you can make an informed choice about your particular requirements.

Chapter 8, "Device Driver Basics," introduces the Linux device driver model and provides enough background to launch into one of the great texts on device drivers, listed as "Suggestions for Additional Reading" at the end of the chapter.

Chapter 9, "File Systems," presents the more popular file systems being used in embedded systems today. We include coverage of the JFFS2, an important embedded file system used on Flash memory devices. This chapter includes a brief introduction on building your own file system image, one of the more difficult tasks the embedded Linux developer faces.

Chapter 10, "MTD Subsystem," explores the Memory Technology Devices (MTD) subsystem. MTD is an extremely useful abstraction layer between the Linux file system and hardware memory devices, primarily Flash memory.

Chapter 11, "BusyBox," introduces BusyBox, one of the most useful utilities for building small embedded systems. We describe how to configure and build BusyBox for your particular requirements, along with detailed coverage of system initialization unique to a BusyBox environment. Appendix C, "BusyBox Commands," lists the available BusyBox commands from a recent BusyBox release.

Chapter 12, "Embedded Development Environment," takes a detailed look at the unique requirements of a typical cross-development environment. Several techniques are presented to enhance your productivity as an embedded developer, including the powerful NFS root mount development configuration.

Chapter 13, "Development Tools," examines many useful development tools. Debugging with gdb is introduced, including coverage of core dump analysis. Many more tools are presented and explained, with examples including strace, ltrace, top, and ps, and the memory profilers mtrace and dmalloc. The chapter concludes with an introduction to the more important binary utilities, including the powerful readelf utility.

Chapter 14, "Kernel Debugging Techniques," provides a detailed examination of many debugging techniques useful for debugging inside the Linux kernel. We introduce the use of the kernel debugger KGDB, and present many useful debugging techniques using the combination of gdb and KGDB as debugging tools. Included is an introduction to using hardware JTAG debuggers and some tips for analyzing failures when the kernel won't boot.

Chapter 15, "Debugging Embedded Linux Applications," moves the debugging context from the kernel to your application programs. We continue to build on the gdb examples from the previous two chapters, and we present techniques for multithreaded and multiprocess debugging.

Chapter 16, "Porting Linux," introduces the issues related to porting Linux to your custom board. We walk through a simple example and highlight the steps taken to produce a working Linux kernel on a custom PowerPC board. Several important concepts are presented that have trapped many newcomers to Linux kernel porting. Together with the techniques presented in Chapters 13 and 14, you should be ready to tackle your own custom board port after reading this chapter.

Chapter 17, "Linux and Real Time," provides an introduction to one of the more exciting developments in embedded Linux: configuring for real time via the CONFIG_RT option. We cover the features available with RT and how they can be used in a design. We also present techniques for measuring latency in your application configuration.

The appendixes cover the GNU Public License, U-Boot Configurable Commands, BusyBox Commands, SDRAM Interface Considerations, resources for the open source developer, and a sample configuration file for one of the more popular hardware JTAG debuggers, the BDI-2000.

Follow Along

You will benefit most from this book if you can divide your time between the pages of this book and your favorite Linux workstation. Grab an old x86 computer to experiment on an embedded system. Even better, if you have access to a single-board computer based on another architecture, use that. You will benefit from learning the layout and organization of a very large code base (the Linux kernel), and you will gain significant knowledge and experience as you poke around the kernel and learn by doing.

Look at the code and try to understand the examples produced in this book. Experiment with different settings, configuration options, and hardware devices. Much can be gained in terms of knowledge, and besides, it's loads of fun!

GPL Copyright Notice

Portions of open-source code reproduced in this book are copyrighted by a large number of individual and corporate contributors. The code reproduced here has been licensed under the terms of the GNU Public License or GPL.

Appendix A contains the text of the GNU General Public License.


New York Times best sellers
Browse the New York Times best sellers in popular categories like Fiction, Nonfiction, Picture Books and more. See more

Product Details

  • Paperback: 576 pages
  • Publisher: Prentice Hall; 1 edition (September 28, 2006)
  • Language: English
  • ISBN-10: 0131679848
  • ISBN-13: 978-0131679849
  • Product Dimensions: 7 x 1.2 x 9.2 inches
  • Shipping Weight: 1.8 pounds
  • Average Customer Review: 4.7 out of 5 stars  See all reviews (19 customer reviews)
  • Amazon Best Sellers Rank: #524,408 in Books (See Top 100 in Books)

Customer Reviews

Top Customer Reviews

By R. B. Dixon on October 6, 2006
Format: Paperback Verified Purchase
Hallinan's book presents a balanced tour of the basic knowledge

required for an embedded Linux design effort. The subject is

exceedingly large and the author wisely chooses to focus on essentials

such as tools, debugging, and architecture. There is less emphasis on

quickly dated material such as source code tours and build

instructions as is found in other texts. This book will add to your

knowledge... not just your script library.

Two attributes of this text are notable: a) This is the only text on

the market with an overview of the latest CONFIG_RT technology found

in the Linux kernel. CONFIG_RT is a new way of reaching real time

performance requirements that does not depend on sub-kernels or

interrupt abstraction. b) The author remains true to making this a

"primer". This is an ideal book to start with and lay the foundation

for future learning
Comment 54 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback Verified Purchase
I am an experienced embedded developer that just inherited an embedded Linux-based project already in progress. As there happens to be no one else at my company with any embedded Linux experience, I automatically became the de-facto Linux expert and I needed to come up to speed on a lot of topics very quickly. I found this book to be an excellent survey of the must-know topics for the embedded Linux developer. It also contains many references to the most definitive sources of information on the various topics. Highly recommended for coming up to speed on embedded Linux.
Comment 28 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This book, the CALAO SYSTEM USB-A9260 card, an eeePC and a cross over cable is all that you need to study embedded system everywhere (even along the Seine river in Paris - yes I did it !).
The chapters about the U-BOOT bootloader, the BUSYBOX embeded Linux and an extra piece of information on the JFFS2 file system are welcome. If the cross-development environment chapter had been about BUILDROOT, this book would have been THE BOOK for the present embedded Linux based systems designers.
Comment 13 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
I am an embedded developer and a linux user/programmer/admin.
When I started joining the "embedded"+"linux" words (and worlds), I found out that I had a lot to learn from this book in both fields.
It's the best on the subject I've read up to now, really professional. The "Primer" in the title does not mean that it's for beginners: it's an advanced guide, and you need to have a background in both "Linux" and "Embedded".
I bought and read it some years ago, but sometimes I like to re-read some parts because I find it always useful and enjoyable.

Moreover, it's well written, fun and easy to read.
There are also a lot of useful references for further readings (I followed many of them!) and web documentations.
Comment 4 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
For those engineers who start their first embedded Linux project, this book is a must have. The book is not for those who want to understand how kernel runs but it gives you the most important concept and work flow to bring up the OS on your development board. The author also provides a useful further reading list in case you want to dig more. A very practical and clearly written book and I would recommend it to those who have solid experience in embedded development but just start to explore in Linux.
Comment 4 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This book is excellent to construct embedded software using Linux. This book explain all the process involved in embedded devices (toolchain, bsp, bootloader, cross-compilation, etc). This book is not inteded as entry book, you must have experience with Linux, C, compilers, etc. There are plenty lines of code an examples therefore is a practical book but you need to work on it

This book is a professional one, therefore this book can carry you to get real embedded linux appliances.

Jorge Luis
Comment 3 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback Verified Purchase
I am just a newbie to the embedded linux world. Of all the books I have seen this book was the best overview but not a great reference book. It is well organized so that someone new to embedded linux will not get overwhelmed but it is also a good overall reference. It goes over all of the different bootloaders, target devices, file systems, busybox, etc. I would NOT recommend it to a reader without some background with linux. The whole embedded linux development moves very quickly so there may be need for new edition soon. It is a must buy if you are interested in learning embedded linux. If you are past the learning phase then it may be less useful.
Comment 2 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
Got this book a few weeks ago and about half-way to finish reading it. Although I have been using Linux for years and work on embedded for living, this book still gives me some insights and answers many of my questions. If you don't want to waste time searching the Internet about Linux for embedded system, this is the book you need.

I particularly like the explanation about booting process end-to-end. The author explains in clear way with examples step-by-step of booting process from power-on to the first running process (init or busybox).

A must-to-have book for embedded software engineers or anybody wants to understand and to build an embedded system with Linux.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse

Most Recent Customer Reviews