Automotive Holiday Deals Books Holiday Gift Guide Shop Men's Athletic Shoes Learn more nav_sap_SWP_6M_fly_beacon Prime Music Sweepstakes egg_2015 All-New Amazon Fire TV Grocery Gifts for Her May The Best Garden Be Yours Amazon Gift Card Offer cm15 cm15 cm15 $30 Off Amazon Echo $30 Off Fire HD 6 Kindle Cyber Monday Deals AutoRip in CDs & Vinyl Shop Now HTL
Embedded Linux Primer: A Practical Real-World Approach and over one million other books are available for Amazon Kindle. Learn more

Enter your mobile number or email address 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.

  • Apple
  • Android
  • Windows Phone
  • Android

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

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

20 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.
Sell yours for a Gift Card
We'll buy it for $2.00
Learn More
Trade in now
Have one to sell? Sell on Amazon
More Buying Choices
11 New from $32.00 19 Used from $7.78
Free Two-Day Shipping for College Students with Amazon Student Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student

Get Up to 80% Back Rent Textbooks

Special Offers and Product Promotions

  • Take an Extra 30% Off Any Book: Use promo code HOLIDAY30 at checkout to get an extra 30% off any book for a limited time. Excludes Kindle eBooks and Audible Audiobooks. Restrictions apply. Learn more | Shop now

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.


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.8 out of 5 stars  See all reviews (20 customer reviews)
  • Amazon Best Sellers Rank: #848,862 in Books (See Top 100 in Books)

Customer Reviews

Most Helpful Customer Reviews

54 of 58 people found the following review helpful 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 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
28 of 28 people found the following review helpful By M. D. Yoke on September 28, 2007
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 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
13 of 13 people found the following review helpful By Gilles on March 9, 2008
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 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
4 of 4 people found the following review helpful By Amazon Customer on February 27, 2010
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 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
4 of 4 people found the following review helpful By T. Yao on May 30, 2008
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 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
3 of 3 people found the following review helpful By Amazon Customer on December 22, 2008
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 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
2 of 2 people found the following review helpful By J. Meyer on February 15, 2009
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 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
3 of 4 people found the following review helpful By iamtron on July 24, 2010
Format: Paperback Verified Purchase
This is a great book. This was one of the text books I had for a course at UCI in their embedded linux course. It provides a great overview to building an embedded linux system. I myself am not a C programmer or really heavy into Linux so my own embedded linux experiences have taken a slightly different turn. I've found development in this area can be extremely demanding and not for the faint of heart. My self and a friend developed an Off Site Backup Appliance a while back using an off the shelf Linux Distribution and familiar x86 Hardware using the Intel Atom. We managed to get the OS setup on a small flashrom and rather than the normal C approach which most texts and engineers take we used Ruby on Rails which is a modern object oriented language which was much simpler to work with coming from a background where we develop desktop and web apps in .net it was an easier transition. I've thought about making it into a kit or book as an example for other folks to spring board from who have a great idea but, maybe not the inclination to completely dive into the embedded world. Send me a comment if anyone could use such an item.
1 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